Files
tsgo/testdata/baselines/reference/submodule/conformance/assignFromBooleanInterface2.js

36 lines
533 B
TypeScript

//// [tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts] ////
//// [assignFromBooleanInterface2.ts]
interface Boolean {
doStuff(): string;
}
interface NotBoolean {
doStuff(): string;
}
var x = true;
declare var a: Boolean;
declare var b: NotBoolean;
a = x;
a = b;
b = a;
b = x;
x = a; // expected error
x = b; // expected error
//// [assignFromBooleanInterface2.js]
"use strict";
var x = true;
a = x;
a = b;
b = a;
b = x;
x = a; // expected error
x = b; // expected error