File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6727,6 +6727,13 @@ export class Compiler extends DiagnosticEmitter {
6727
6727
case ElementKind . PROPERTY : { // instance property (here: getter)
6728
6728
return this . compileGetter ( < Property > target , propertyAccess ) ;
6729
6729
}
6730
+ case ElementKind . FUNCTION_PROTOTYPE : {
6731
+ this . error (
6732
+ DiagnosticCode . Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set ,
6733
+ propertyAccess . range , ( < FunctionPrototype > target ) . simpleName
6734
+ ) ;
6735
+ return module . createUnreachable ( ) ;
6736
+ }
6730
6737
}
6731
6738
this . error (
6732
6739
DiagnosticCode . Operation_not_supported ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export enum DiagnosticCode {
28
28
Optional_parameter_must_have_an_initializer = 215 ,
29
29
Constructor_of_class_0_must_not_require_any_arguments = 216 ,
30
30
Function_0_cannot_be_inlined_into_itself = 217 ,
31
+ Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218 ,
31
32
Unterminated_string_literal = 1002 ,
32
33
Identifier_expected = 1003 ,
33
34
_0_expected = 1005 ,
@@ -147,6 +148,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
147
148
case 215 : return "Optional parameter must have an initializer." ;
148
149
case 216 : return "Constructor of class '{0}' must not require any arguments." ;
149
150
case 217 : return "Function '{0}' cannot be inlined into itself." ;
151
+ case 218 : return "Cannot access method '{0}' without calling it as it requires 'this' to be set." ;
150
152
case 1002 : return "Unterminated string literal." ;
151
153
case 1003 : return "Identifier expected." ;
152
154
case 1005 : return "'{0}' expected." ;
Original file line number Diff line number Diff line change 20
20
"Optional parameter must have an initializer." : 215 ,
21
21
"Constructor of class '{0}' must not require any arguments." : 216 ,
22
22
"Function '{0}' cannot be inlined into itself." : 217 ,
23
+ "Cannot access method '{0}' without calling it as it requires 'this' to be set." : 218 ,
23
24
24
25
"Unterminated string literal." : 1002 ,
25
26
"Identifier expected." : 1003 ,
You can’t perform that action at this time.
0 commit comments