40 lines
No EOL
1.5 KiB
Text
40 lines
No EOL
1.5 KiB
Text
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(14,1): error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'.
|
|
Types of property 'valueOf' are incompatible.
|
|
Type '() => Object' is not assignable to type '() => boolean'.
|
|
Type 'Object' is not assignable to type 'boolean'.
|
|
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
|
|
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'.
|
|
|
|
|
|
==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts (3 errors) ====
|
|
interface Boolean {
|
|
doStuff(): string;
|
|
}
|
|
|
|
interface NotBoolean {
|
|
doStuff(): string;
|
|
}
|
|
|
|
var x = true;
|
|
var a: Boolean;
|
|
var b: NotBoolean;
|
|
|
|
a = x;
|
|
a = b;
|
|
~
|
|
!!! error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'.
|
|
!!! error TS2322: Types of property 'valueOf' are incompatible.
|
|
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
|
|
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
|
|
|
|
b = a;
|
|
b = x;
|
|
|
|
x = a; // expected error
|
|
~
|
|
!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
|
|
x = b; // expected error
|
|
~
|
|
!!! error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'.
|
|
|
|
|