2014-07-13 01:04:16 +02:00
|
|
|
//// [augmentedTypesFunction.ts]
|
|
|
|
// function then var
|
2014-10-01 02:15:18 +02:00
|
|
|
function y1() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var y1 = 1; // error
|
|
|
|
|
|
|
|
// function then function
|
2014-10-01 02:15:18 +02:00
|
|
|
function y2() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
function y2() { } // error
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
function y2a() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var y2a = () => { } // error
|
|
|
|
|
|
|
|
// function then class
|
2014-10-01 02:15:18 +02:00
|
|
|
function y3() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
class y3 { } // error
|
|
|
|
|
2014-10-01 02:15:18 +02:00
|
|
|
function y3a() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
class y3a { public foo() { } } // error
|
|
|
|
|
|
|
|
// function then enum
|
2014-10-01 02:15:18 +02:00
|
|
|
function y4() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
enum y4 { One } // error
|
|
|
|
|
|
|
|
// function then internal module
|
|
|
|
function y5() { }
|
|
|
|
module y5 { } // ok since module is not instantiated
|
|
|
|
|
|
|
|
function y5a() { }
|
|
|
|
module y5a { var y = 2; } // should be an error
|
|
|
|
|
|
|
|
function y5b() { }
|
|
|
|
module y5b { export var y = 3; } // should be an error
|
|
|
|
|
|
|
|
function y5c() { }
|
|
|
|
module y5c { export interface I { foo(): void } } // should be an error
|
|
|
|
|
|
|
|
// function then import, messes with other errors
|
|
|
|
//function y6() { }
|
|
|
|
//import y6 = require('');
|
|
|
|
|
|
|
|
//// [augmentedTypesFunction.js]
|
2014-08-14 15:21:30 +02:00
|
|
|
// function then var
|
2015-02-07 03:45:09 +01:00
|
|
|
function y1() { } // error
|
2014-08-15 22:18:54 +02:00
|
|
|
var y1 = 1; // error
|
2014-08-14 15:21:30 +02:00
|
|
|
// function then function
|
2015-02-07 03:45:09 +01:00
|
|
|
function y2() { } // error
|
|
|
|
function y2() { } // error
|
|
|
|
function y2a() { } // error
|
|
|
|
var y2a = function () { }; // error
|
2014-08-14 15:21:30 +02:00
|
|
|
// function then class
|
2015-02-07 03:45:09 +01:00
|
|
|
function y3() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var y3 = (function () {
|
|
|
|
function y3() {
|
|
|
|
}
|
|
|
|
return y3;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(); // error
|
2015-02-07 03:45:09 +01:00
|
|
|
function y3a() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var y3a = (function () {
|
|
|
|
function y3a() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
y3a.prototype.foo = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return y3a;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(); // error
|
2014-08-14 15:21:30 +02:00
|
|
|
// function then enum
|
2015-02-07 03:45:09 +01:00
|
|
|
function y4() { } // error
|
2014-07-13 01:04:16 +02:00
|
|
|
var y4;
|
|
|
|
(function (y4) {
|
|
|
|
y4[y4["One"] = 0] = "One";
|
2014-08-15 22:18:54 +02:00
|
|
|
})(y4 || (y4 = {})); // error
|
2014-08-14 15:21:30 +02:00
|
|
|
// function then internal module
|
2015-02-07 03:45:09 +01:00
|
|
|
function y5() { }
|
|
|
|
function y5a() { }
|
2014-07-13 01:04:16 +02:00
|
|
|
var y5a;
|
|
|
|
(function (y5a) {
|
|
|
|
var y = 2;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(y5a || (y5a = {})); // should be an error
|
2015-02-07 03:45:09 +01:00
|
|
|
function y5b() { }
|
2014-07-13 01:04:16 +02:00
|
|
|
var y5b;
|
|
|
|
(function (y5b) {
|
|
|
|
y5b.y = 3;
|
2014-08-15 22:18:54 +02:00
|
|
|
})(y5b || (y5b = {})); // should be an error
|
2015-02-07 03:45:09 +01:00
|
|
|
function y5c() { }
|
2014-12-03 01:09:41 +01:00
|
|
|
// function then import, messes with other errors
|
|
|
|
//function y6() { }
|
|
|
|
//import y6 = require('');
|