TypeScript/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt

20 lines
860 B
Plaintext

tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'.
Property 'a' is missing in type 'Boolean'.
==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ====
import foo = require("./foo_0");
var x = new foo(true); // Should error
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'.
!!! error TS2345: Property 'a' is missing in type 'Boolean'.
var y = new foo({a: "test", b: 42}); // Should be OK
var z: number = y.test.b;
==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ====
class Foo<T extends {a: string; b:number;}>{
test: T;
constructor(x: T){}
}
export = Foo;