In effect this fixes #62. Also - Changes the error message for get accessors lacking return expressions. - Actually checks for return expressions instead of return statements for get-accessors. - Removes fancy quotes. - Corrects errors in the compiler caught by the new check. - Simplified `checkAndAggregateReturnTypes` by extracting it out to `visitReturnStatements`.
8 lines
No EOL
342 B
Text
8 lines
No EOL
342 B
Text
==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration12.ts (2 errors) ====
|
|
class C {
|
|
get Foo(a: number) { }
|
|
~~~
|
|
!!! A 'get' accessor cannot have parameters.
|
|
~~~
|
|
!!! A 'get' accessor must return a value or consist of a single 'throw' statement.
|
|
} |