mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
36 lines
533 B
TypeScript
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
|