2014-07-13 01:04:16 +02:00
|
|
|
//// [voidOperatorWithBooleanType.ts]
|
|
|
|
// void operator on boolean type
|
|
|
|
var BOOLEAN: boolean;
|
|
|
|
|
|
|
|
function foo(): boolean { return true; }
|
|
|
|
|
|
|
|
class A {
|
|
|
|
public a: boolean;
|
|
|
|
static foo() { return false; }
|
|
|
|
}
|
|
|
|
module M {
|
|
|
|
export var n: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
var objA = new A();
|
|
|
|
|
|
|
|
// boolean type var
|
|
|
|
var ResultIsAny1 = void BOOLEAN;
|
|
|
|
|
|
|
|
// boolean type literal
|
|
|
|
var ResultIsAny2 = void true;
|
|
|
|
var ResultIsAny3 = void { x: true, y: false };
|
|
|
|
|
|
|
|
// boolean type expressions
|
|
|
|
var ResultIsAny4 = void objA.a;
|
|
|
|
var ResultIsAny5 = void M.n;
|
|
|
|
var ResultIsAny6 = void foo();
|
|
|
|
var ResultIsAny7 = void A.foo();
|
|
|
|
|
|
|
|
// multiple void operator
|
|
|
|
var ResultIsAny8 = void void BOOLEAN;
|
|
|
|
|
|
|
|
// miss assignment operators
|
|
|
|
void true;
|
|
|
|
void BOOLEAN;
|
|
|
|
void foo();
|
|
|
|
void true, false;
|
|
|
|
void objA.a;
|
|
|
|
void M.n;
|
|
|
|
|
|
|
|
//// [voidOperatorWithBooleanType.js]
|
2014-08-12 00:54:12 +02:00
|
|
|
// void operator on boolean type
|
2014-07-13 01:04:16 +02:00
|
|
|
var BOOLEAN;
|
2015-02-07 05:03:24 +01:00
|
|
|
function foo() { return true; }
|
2014-07-13 01:04:16 +02:00
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
|
|
|
}
|
2015-02-07 05:03:24 +01:00
|
|
|
A.foo = function () { return false; };
|
2014-07-13 01:04:16 +02:00
|
|
|
return A;
|
|
|
|
})();
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
M.n;
|
|
|
|
})(M || (M = {}));
|
|
|
|
var objA = new A();
|
2014-08-12 00:54:12 +02:00
|
|
|
// boolean type var
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsAny1 = void BOOLEAN;
|
2014-08-12 00:54:12 +02:00
|
|
|
// boolean type literal
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsAny2 = void true;
|
|
|
|
var ResultIsAny3 = void { x: true, y: false };
|
2014-08-12 00:54:12 +02:00
|
|
|
// boolean type expressions
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsAny4 = void objA.a;
|
|
|
|
var ResultIsAny5 = void M.n;
|
|
|
|
var ResultIsAny6 = void foo();
|
|
|
|
var ResultIsAny7 = void A.foo();
|
2014-08-12 00:54:12 +02:00
|
|
|
// multiple void operator
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsAny8 = void void BOOLEAN;
|
2014-08-16 00:49:09 +02:00
|
|
|
// miss assignment operators
|
2014-07-13 01:04:16 +02:00
|
|
|
void true;
|
|
|
|
void BOOLEAN;
|
|
|
|
void foo();
|
|
|
|
void true, false;
|
|
|
|
void objA.a;
|
|
|
|
void M.n;
|