Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/compiler-cli/src/ngtsc/testing/fake_core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export interface InputFunction {
export const input: InputFunction = null!;

export type ɵUnwrapInputSignalWriteType<Field> =
Field extends InputSignalWithTransform<unknown, infer WriteT>? WriteT : never;
Field extends InputSignalWithTransform<any, infer WriteT>? WriteT : never;
export type ɵUnwrapDirectiveSignalInputs<Dir, Fields extends keyof Dir> = {
[P in Fields]: ɵUnwrapInputSignalWriteType<Dir[P]>
};
Expand Down
14 changes: 12 additions & 2 deletions packages/compiler-cli/src/ngtsc/typecheck/test/test_case_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import ts from 'typescript';

import {TypeCheckingConfig} from '../api';
import {diagnose} from '../testing';

Expand Down Expand Up @@ -54,7 +56,7 @@ export interface TestCase {
* Diagnoses the given test case, by constructing the test TypeScript file
* and running the type checker on it.
*/
export function typeCheckDiagnose(c: TestCase) {
export function typeCheckDiagnose(c: TestCase, compilerOptions?: ts.CompilerOptions) {
const inputs = c.inputs ?? {};
const outputs = c.outputs ?? {};

Expand Down Expand Up @@ -124,7 +126,7 @@ export function typeCheckDiagnose(c: TestCase) {
.map(([name]) => name),
},
],
undefined, c.options);
undefined, c.options, compilerOptions);

expect(messages).toEqual(c.expected);
}
Expand All @@ -136,4 +138,12 @@ export function generateDiagnoseJasmineSpecs(cases: TestCase[]): void {
typeCheckDiagnose(c);
});
}

describe('with `--strict`', () => {
for (const c of cases) {
(c.focus ? fit : it)(c.id, () => {
typeCheckDiagnose(c, {strict: true});
});
}
});
}
2 changes: 1 addition & 1 deletion packages/core/src/authoring/input/input_type_checking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {InputSignalWithTransform} from './input_signal';

/** Retrieves the `WriteT` of an `InputSignal` and `InputSignalWithTransform`. */
export type ɵUnwrapInputSignalWriteType<Field> =
Field extends InputSignalWithTransform<unknown, infer WriteT>? WriteT : never;
Field extends InputSignalWithTransform<any, infer WriteT>? WriteT : never;

/**
* Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of
Expand Down