Add test case
This commit is contained in:
parent
470d1d28ab
commit
c72861ebd7
3 changed files with 101 additions and 0 deletions
63
tests/baselines/reference/overloadConsecutiveness.errors.txt
Normal file
63
tests/baselines/reference/overloadConsecutiveness.errors.txt
Normal file
|
@ -0,0 +1,63 @@
|
|||
tests/cases/compiler/overloadConsecutiveness.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(3,14): error TS1144: '{' or ';' expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(3,25): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(4,14): error TS1144: '{' or ';' expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(5,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(5,17): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(5,28): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(8,2): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(8,6): error TS1144: '{' or ';' expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(8,8): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(9,2): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(9,6): error TS1144: '{' or ';' expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(10,2): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(10,9): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/overloadConsecutiveness.ts(10,11): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overloadConsecutiveness.ts (16 errors) ====
|
||||
// Making sure compiler won't break with declarations that are consecutive in the AST but not consecutive in the source. Syntax errors intentional.
|
||||
|
||||
function f1(), function f1();
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
function f2(), function f2() {}
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
function f3() {}, function f3();
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1128: Declaration or statement expected.
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
|
||||
class C {
|
||||
m1(), m1();
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
m2(), m2() {}
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1144: '{' or ';' expected.
|
||||
m3() {}, m3();
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
27
tests/baselines/reference/overloadConsecutiveness.js
Normal file
27
tests/baselines/reference/overloadConsecutiveness.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
//// [overloadConsecutiveness.ts]
|
||||
// Making sure compiler won't break with declarations that are consecutive in the AST but not consecutive in the source. Syntax errors intentional.
|
||||
|
||||
function f1(), function f1();
|
||||
function f2(), function f2() {}
|
||||
function f3() {}, function f3();
|
||||
|
||||
class C {
|
||||
m1(), m1();
|
||||
m2(), m2() {}
|
||||
m3() {}, m3();
|
||||
}
|
||||
|
||||
|
||||
//// [overloadConsecutiveness.js]
|
||||
// Making sure compiler won't break with declarations that are consecutive in the AST but not consecutive in the source. Syntax errors intentional.
|
||||
function f2() { }
|
||||
function f3() { }
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.m1 = ;
|
||||
C.prototype.m2 = ;
|
||||
C.prototype.m2 = function () { };
|
||||
C.prototype.m3 = function () { };
|
||||
return C;
|
||||
})();
|
11
tests/cases/compiler/overloadConsecutiveness.ts
Normal file
11
tests/cases/compiler/overloadConsecutiveness.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Making sure compiler won't break with declarations that are consecutive in the AST but not consecutive in the source. Syntax errors intentional.
|
||||
|
||||
function f1(), function f1();
|
||||
function f2(), function f2() {}
|
||||
function f3() {}, function f3();
|
||||
|
||||
class C {
|
||||
m1(), m1();
|
||||
m2(), m2() {}
|
||||
m3() {}, m3();
|
||||
}
|
Loading…
Reference in a new issue