2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(6,5): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/augmentedTypesVar.ts(7,1): error TS2300: Duplicate identifier 'x2'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identifier 'x4'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'.
2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(17,7): error TS2300: Duplicate identifier 'x4a'.
2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(20,5): error TS2300: Duplicate identifier 'x5'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(21,6): error TS2300: Duplicate identifier 'x5'.
2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(27,5): error TS2300: Duplicate identifier 'x6a'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(28,8): error TS2300: Duplicate identifier 'x6a'.
2014-10-01 02:15:18 +02:00
tests/cases/compiler/augmentedTypesVar.ts(30,5): error TS2300: Duplicate identifier 'x6b'.
2014-09-12 22:35:07 +02:00
tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'.
2014-10-01 02:15:18 +02:00
==== tests/cases/compiler/augmentedTypesVar.ts (13 errors) ====
2014-07-13 01:04:16 +02:00
// var then var
var x1 = 1;
var x1 = 2;
// var then function
2014-10-01 02:15:18 +02:00
var x2 = 1; // error
~~
!!! error TS2300: Duplicate identifier 'x2'.
function x2() { } // error
~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x2'.
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
~~
2014-09-12 00:19:57 +02:00
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
2014-07-13 01:04:16 +02:00
// var then class
2014-10-01 02:15:18 +02:00
var x4 = 1; // error
~~
!!! error TS2300: Duplicate identifier 'x4'.
2014-07-13 01:04:16 +02:00
class x4 { } // error
~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x4'.
2014-07-13 01:04:16 +02:00
2014-10-01 02:15:18 +02:00
var x4a = 1; // error
~~~
!!! error TS2300: Duplicate identifier 'x4a'.
2014-07-13 01:04:16 +02:00
class x4a { public foo() { } } // error
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x4a'.
2014-07-13 01:04:16 +02:00
// var then enum
var x5 = 1;
2014-10-01 02:15:18 +02:00
~~
!!! error TS2300: Duplicate identifier 'x5'.
2014-07-13 01:04:16 +02:00
enum x5 { One } // error
~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x5'.
2014-07-13 01:04:16 +02:00
// var then module
var x6 = 1;
module x6 { } // ok since non-instantiated
2014-10-01 02:15:18 +02:00
var x6a = 1; // error
~~~
!!! error TS2300: Duplicate identifier 'x6a'.
2014-07-13 01:04:16 +02:00
module x6a { var y = 2; } // error since instantiated
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x6a'.
2014-07-13 01:04:16 +02:00
2014-10-01 02:15:18 +02:00
var x6b = 1; // error
~~~
!!! error TS2300: Duplicate identifier 'x6b'.
2014-07-13 01:04:16 +02:00
module x6b { export var y = 2; } // error
~~~
2014-09-12 00:19:57 +02:00
!!! error TS2300: Duplicate identifier 'x6b'.
2014-07-13 01:04:16 +02:00
// var then import, messes with other error reporting
//var x7 = 1;
//import x7 = require('');