-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Disallow statements between overloads #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -623,8 +623,12 @@ | |
"Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { | ||
"category": "Error", | ||
"code": 2235 | ||
}, | ||
"Constructor implementation expected.": { | ||
}, | ||
"Function implementation name must be '{0}'.": { | ||
"category": "Error", | ||
"code": 2239 | ||
}, | ||
"Constructor implementation is missing.": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error message was changed from "Constructor implementation expected." to "Constructor implementation is missing.". Given that error is usually reported on the line that contains the last overload wording "Constructor implementation expected." is not clear enough to explain what went wrong (should I create implementation instead of this overloads? But what if I need this overloads? etc...). In opposite "Constructor implementation is missing." implies that this overload itself is ok but it lacks implementation and thus error is reported There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems too generic, the problem may not be a missing implementation per se but an implementation that is separated from the declaration.. so something like "Function implementation is missing or not immediately following the declaration", or "Function implementation is expected to follow the declaration" .. etc.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, makes sense. I'll change it to "Function implementation is missing or not immediately following the declaration" |
||
"category": "Error", | ||
"code": 2240 | ||
}, | ||
|
@@ -636,6 +640,14 @@ | |
"category": "Error", | ||
"code": 2246 | ||
}, | ||
"Function overload must be static.": { | ||
"category": "Error", | ||
"code": 2247 | ||
}, | ||
"Function overload must not be static.": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also possible: "Function overload cannot be static" or "Function overload must be non-static." - I'm a bigger fan of the first. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 for "Function overload cannot be static" |
||
"category": "Error", | ||
"code": 2248 | ||
}, | ||
"Circular definition of import alias '{0}'.": { | ||
"category": "Error", | ||
"code": 3000 | ||
|
@@ -900,7 +912,6 @@ | |
"category": "Error", | ||
"code": 7020 | ||
}, | ||
|
||
"Variable declaration list cannot be empty.": { | ||
"category": "Error", | ||
"code": -9999999 | ||
|
@@ -1121,7 +1132,7 @@ | |
"category": "Error", | ||
"code": -9999999 | ||
}, | ||
"Function implementation expected.": { | ||
"Function implementation is missing or not immediately following the declaration.": { | ||
"category": "Error", | ||
"code": -9999999 | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
==== tests/cases/compiler/ClassDeclaration13.ts (1 errors) ==== | ||
class C { | ||
foo(); | ||
~~~~~~ | ||
!!! Function implementation expected. | ||
bar() { } | ||
~~~ | ||
!!! Function implementation name must be 'foo'. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
==== tests/cases/compiler/ClassDeclaration14.ts (2 errors) ==== | ||
class C { | ||
foo(); | ||
~~~~~~ | ||
!!! Function implementation expected. | ||
~~~ | ||
!!! Function implementation is missing or not immediately following the declaration. | ||
constructor(); | ||
~~~~~~~~~~~~~~ | ||
!!! Constructor implementation expected. | ||
!!! Constructor implementation is missing. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
==== tests/cases/compiler/ClassDeclaration15.ts (1 errors) ==== | ||
class C { | ||
foo(); | ||
~~~~~~ | ||
!!! Function implementation expected. | ||
~~~ | ||
!!! Function implementation is missing or not immediately following the declaration. | ||
constructor() { } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
==== tests/cases/compiler/ClassDeclaration21.ts (1 errors) ==== | ||
class C { | ||
0(); | ||
~~~~ | ||
!!! Function implementation expected. | ||
1() { } | ||
~ | ||
!!! Function implementation name must be '0'. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
==== tests/cases/compiler/ClassDeclaration22.ts (1 errors) ==== | ||
class C { | ||
"foo"(); | ||
~~~~~~~~ | ||
!!! Function implementation expected. | ||
"bar"() { } | ||
~~~~~ | ||
!!! Function implementation name must be '"foo"'. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
==== tests/cases/compiler/ClassDeclaration9.ts (1 errors) ==== | ||
class C { | ||
foo(); | ||
~~~~~~ | ||
!!! Function implementation expected. | ||
~~~ | ||
!!! Function implementation is missing or not immediately following the declaration. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
==== tests/cases/compiler/FunctionDeclaration3.ts (1 errors) ==== | ||
function foo(); | ||
~~~~~~~~~~~~~~~ | ||
!!! Function implementation expected. | ||
~~~ | ||
!!! Function implementation is missing or not immediately following the declaration. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
==== tests/cases/compiler/FunctionDeclaration4.ts (1 errors) ==== | ||
function foo(); | ||
~~~~~~~~~~~~~~~ | ||
!!! Function implementation expected. | ||
function bar() { } | ||
function bar() { } | ||
~~~ | ||
!!! Function implementation name must be 'foo'. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
==== tests/cases/compiler/FunctionDeclaration6.ts (1 errors) ==== | ||
{ | ||
function foo(); | ||
~~~~~~~~~~~~~~~ | ||
!!! Function implementation expected. | ||
function bar() { } | ||
~~~ | ||
!!! Function implementation name must be 'foo'. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
==== tests/cases/compiler/FunctionDeclaration7.ts (1 errors) ==== | ||
module M { | ||
function foo(); | ||
~~~~~~~~~~~~~~~ | ||
!!! Function implementation expected. | ||
~~~ | ||
!!! Function implementation is missing or not immediately following the declaration. | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't make a difference, but my preference is
Feel free to keep it the same.