2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/assignmentCompatability43.ts (1 errors) ====
|
|
|
|
module __test1__ {
|
|
|
|
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
|
|
|
export var __val__obj4 = obj4;
|
|
|
|
}
|
|
|
|
module __test2__ {
|
|
|
|
export interface interfaceTwo<T,U> { one: T; two: U; }; var obj2: interfaceTwo<number,string> = { one: 1, two: "a" };;
|
|
|
|
export var __val__obj2 = obj2;
|
|
|
|
}
|
|
|
|
__test2__.__val__obj2 = __test1__.__val__obj4
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'interfaceTwo<number, string>':
|
2014-09-17 19:36:32 +02:00
|
|
|
!!! Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type 'interfaceTwo<number, string>'.
|