mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-10 12:01:53 +00:00
Improve error message for accessing method like a field (#253)
This commit is contained in:
committed by
Daniel Wirtz
parent
3605630747
commit
ef2c0c623e
@ -6727,6 +6727,13 @@ export class Compiler extends DiagnosticEmitter {
|
||||
case ElementKind.PROPERTY: {// instance property (here: getter)
|
||||
return this.compileGetter(<Property>target, propertyAccess);
|
||||
}
|
||||
case ElementKind.FUNCTION_PROTOTYPE: {
|
||||
this.error(
|
||||
DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,
|
||||
propertyAccess.range, (<FunctionPrototype>target).simpleName
|
||||
);
|
||||
return module.createUnreachable();
|
||||
}
|
||||
}
|
||||
this.error(
|
||||
DiagnosticCode.Operation_not_supported,
|
||||
|
Reference in New Issue
Block a user