* Improve non-ambient class and function merge error * Update baselines * Update tests Co-authored-by: Austin Cummings <austin@austincummings.com>
81 lines
3.9 KiB
Plaintext
81 lines
3.9 KiB
Plaintext
tests/cases/compiler/augmentedTypesFunction.ts(2,10): error TS2300: Duplicate identifier 'y1'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(3,5): error TS2300: Duplicate identifier 'y1'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(6,10): error TS2393: Duplicate function implementation.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(7,10): error TS2393: Duplicate function implementation.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(9,10): error TS2300: Duplicate identifier 'y2a'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(10,5): error TS2300: Duplicate identifier 'y2a'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(13,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(14,7): error TS2813: Class declaration cannot implement overload list for 'y3'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(16,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(17,7): error TS2813: Class declaration cannot implement overload list for 'y3a'.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(20,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
|
tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
|
|
|
|
|
==== tests/cases/compiler/augmentedTypesFunction.ts (12 errors) ====
|
|
// function then var
|
|
function y1() { } // error
|
|
~~
|
|
!!! error TS2300: Duplicate identifier 'y1'.
|
|
var y1 = 1; // error
|
|
~~
|
|
!!! error TS2300: Duplicate identifier 'y1'.
|
|
|
|
// function then function
|
|
function y2() { } // error
|
|
~~
|
|
!!! error TS2393: Duplicate function implementation.
|
|
function y2() { } // error
|
|
~~
|
|
!!! error TS2393: Duplicate function implementation.
|
|
|
|
function y2a() { } // error
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier 'y2a'.
|
|
var y2a = () => { } // error
|
|
~~~
|
|
!!! error TS2300: Duplicate identifier 'y2a'.
|
|
|
|
// function then class
|
|
function y3() { } // error
|
|
~~
|
|
!!! error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 tests/cases/compiler/augmentedTypesFunction.ts:14:7: Consider adding a 'declare' modifier to this class.
|
|
class y3 { } // error
|
|
~~
|
|
!!! error TS2813: Class declaration cannot implement overload list for 'y3'.
|
|
!!! related TS6506 tests/cases/compiler/augmentedTypesFunction.ts:14:7: Consider adding a 'declare' modifier to this class.
|
|
|
|
function y3a() { } // error
|
|
~~~
|
|
!!! error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 tests/cases/compiler/augmentedTypesFunction.ts:17:7: Consider adding a 'declare' modifier to this class.
|
|
class y3a { public foo() { } } // error
|
|
~~~
|
|
!!! error TS2813: Class declaration cannot implement overload list for 'y3a'.
|
|
!!! related TS6506 tests/cases/compiler/augmentedTypesFunction.ts:17:7: Consider adding a 'declare' modifier to this class.
|
|
|
|
// function then enum
|
|
function y4() { } // error
|
|
~~
|
|
!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
|
enum y4 { One } // error
|
|
~~
|
|
!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
|
|
|
// 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(''); |