2014-07-13 01:04:16 +02:00
|
|
|
//// [augmentedTypesVar.ts]
|
|
|
|
// var then var
|
|
|
|
var x1 = 1;
|
|
|
|
var x1 = 2;
|
|
|
|
|
|
|
|
// var then function
|
2014-10-01 02:15:18 +02:00
|
|
|
var x2 = 1; // error
|
|
|
|
function x2() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
var x3 = 1;
|
|
|
|
var x3 = () => { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
// var then class
|
2014-10-01 02:15:18 +02:00
|
|
|
var x4 = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
class x4 { } // error
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
var x4a = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
class x4a { public foo() { } } // error
|
|
|
|
|
|
|
|
// var then enum
|
|
|
|
var x5 = 1;
|
|
|
|
enum x5 { One } // error
|
|
|
|
|
|
|
|
// var then module
|
|
|
|
var x6 = 1;
|
|
|
|
module x6 { } // ok since non-instantiated
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
var x6a = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
module x6a { var y = 2; } // error since instantiated
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
var x6b = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
module x6b { export var y = 2; } // error
|
|
|
|
|
|
|
|
// var then import, messes with other error reporting
|
|
|
|
//var x7 = 1;
|
|
|
|
//import x7 = require('');
|
|
|
|
|
|
|
|
|
|
|
|
//// [augmentedTypesVar.js]
|
2014-08-12 00:54:12 +02:00
|
|
|
// var then var
|
2014-07-13 01:04:16 +02:00
|
|
|
var x1 = 1;
|
|
|
|
var x1 = 2;
|
2014-08-12 00:54:12 +02:00
|
|
|
// var then function
|
2014-10-01 02:15:18 +02:00
|
|
|
var x2 = 1; // error
|
2015-02-07 03:45:09 +01:00
|
|
|
function x2() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var x3 = 1;
|
2015-02-07 03:45:09 +01:00
|
|
|
var x3 = function () { }; // error
|
2014-08-12 00:54:12 +02:00
|
|
|
// var then class
|
2014-10-01 02:15:18 +02:00
|
|
|
var x4 = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var x4 = (function () {
|
|
|
|
function x4() {
|
|
|
|
}
|
|
|
|
return x4;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(); // error
|
2014-10-01 02:15:18 +02:00
|
|
|
var x4a = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var x4a = (function () {
|
|
|
|
function x4a() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
x4a.prototype.foo = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return x4a;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(); // error
|
2014-08-12 00:54:12 +02:00
|
|
|
// var then enum
|
2014-07-13 01:04:16 +02:00
|
|
|
var x5 = 1;
|
|
|
|
var x5;
|
|
|
|
(function (x5) {
|
|
|
|
x5[x5["One"] = 0] = "One";
|
2014-08-15 22:18:54 +02:00
|
|
|
})(x5 || (x5 = {})); // error
|
2014-08-12 00:54:12 +02:00
|
|
|
// var then module
|
2014-07-13 01:04:16 +02:00
|
|
|
var x6 = 1;
|
2014-10-01 02:15:18 +02:00
|
|
|
var x6a = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var x6a;
|
|
|
|
(function (x6a) {
|
|
|
|
var y = 2;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(x6a || (x6a = {})); // error since instantiated
|
2014-10-01 02:15:18 +02:00
|
|
|
var x6b = 1; // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var x6b;
|
|
|
|
(function (x6b) {
|
|
|
|
x6b.y = 2;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(x6b || (x6b = {})); // error
|
2014-12-03 01:09:41 +01:00
|
|
|
// var then import, messes with other error reporting
|
|
|
|
//var x7 = 1;
|
|
|
|
//import x7 = require('');
|