You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/constAssertions.errors.txt
+18-2
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@ tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(44,32): er
2
2
tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(61,10): error TS1355: A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.
3
3
tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(62,10): error TS1355: A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.
4
4
tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(63,10): error TS1355: A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.
5
+
tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(118,3): error TS2322: Type '3' is not assignable to type '2'.
@@ -120,4 +121,19 @@ tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(63,10): er
120
121
return [`get-${propName}`, `set-${propName}`] as const;
121
122
}
122
123
123
-
const ns1 = accessorNames('foo');
124
+
const ns1 = accessorNames('foo');
125
+
126
+
// repro from https://github.com/microsoft/TypeScript/issues/54374
127
+
interface Foo54374 {
128
+
a: 1;
129
+
b: 2;
130
+
}
131
+
132
+
const fooConst54374: Foo54374 = {
133
+
a: 1,
134
+
b: 3
135
+
~
136
+
!!! error TS2322: Type '3' is not assignable to type '2'.
137
+
!!! related TS6500 tests/cases/conformance/expressions/typeAssertions/constAssertions.ts:113:3: The expected type comes from property 'b' which is declared here on type 'Foo54374'
0 commit comments