Skip to content

Commit 513a162

Browse files
committed
Make parseCommandLineWorker non generic
1 parent 4ed63e5 commit 513a162

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,12 +912,12 @@ namespace ts {
912912
/** Tuple with error messages for 'unknown compiler option', 'option requires type' */
913913
type ParseCommandLineWorkerDiagnostics = [DiagnosticMessage, DiagnosticMessage];
914914

915-
function parseCommandLineWorker<T extends OptionsBase>(
915+
function parseCommandLineWorker(
916916
getOptionNameMap: () => OptionNameMap,
917917
[unknownOptionDiagnostic, optionTypeMismatchDiagnostic]: ParseCommandLineWorkerDiagnostics,
918918
commandLine: ReadonlyArray<string>,
919919
readFile?: (path: string) => string | undefined) {
920-
const options = {} as T;
920+
const options = {} as OptionsBase;
921921
const fileNames: string[] = [];
922922
const errors: Diagnostic[] = [];
923923

@@ -1061,10 +1061,11 @@ namespace ts {
10611061
export function parseBuildCommand(args: string[]): ParsedBuildCommand {
10621062
let buildOptionNameMap: OptionNameMap | undefined;
10631063
const returnBuildOptionNameMap = () => (buildOptionNameMap || (buildOptionNameMap = createOptionNameMap(buildOpts)));
1064-
const { options: buildOptions, fileNames: projects, errors } = parseCommandLineWorker<BuildOptions>(returnBuildOptionNameMap, [
1064+
const { options, fileNames: projects, errors } = parseCommandLineWorker(returnBuildOptionNameMap, [
10651065
Diagnostics.Unknown_build_option_0,
10661066
Diagnostics.Build_option_0_requires_a_value_of_type_1
10671067
], args);
1068+
const buildOptions = options as BuildOptions;
10681069

10691070
if (projects.length === 0) {
10701071
// tsc -b invoked with no extra arguments; act as if invoked with "tsc -b ."

0 commit comments

Comments
 (0)