Files
tsgo/testdata/baselines/reference/compiler/varianceModifiersOnClassMembers.errors.txt
a980d869b6 Elide in/out variance modifiers from emitted JS (#4156)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jakebailey <[email protected]>
2026-06-01 20:40:58 +00:00

21 lines
812 B
Plaintext

varianceModifiersOnClassMembers.ts(4,3): error TS1274: 'in' modifier can only appear on a type parameter of a class, interface or type alias
varianceModifiersOnClassMembers.ts(5,3): error TS1274: 'out' modifier can only appear on a type parameter of a class, interface or type alias
==== varianceModifiersOnClassMembers.ts (2 errors) ====
// https://github.com/microsoft/typescript-go/issues/4123
class C {
in x = 1;
~~
!!! error TS1274: 'in' modifier can only appear on a type parameter of a class, interface or type alias
out y = 2;
~~~
!!! error TS1274: 'out' modifier can only appear on a type parameter of a class, interface or type alias
}
const isIn = "x" in { x: 1 };
for (const k in { x: 1 }) {
console.log(k);
}