"anonymous abstract function" with symbol-identified methods
See original GitHub issueThe following code:
export interface AccessorBase<T> {
readonly $accessPath: AccessPath<any, T>;
readonly $parent: ObjectAccessor<{}> | ListAccessor<object> | undefined;
[accessPathSymbol](): AccessPath<any, T>;
}
generates the error anonymous abstract function. This is most likely the case because propertyName
only considers identifiers and string literals, and not symbols. I have not checked, but I would gess ['methodName'](): string
causes the same error.
The problem has been introduced in version 0.33.0 - 0.32.1 works.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Overriding abstract method using anonymous class
I'm trying to override a abstract method using anonymous class but it shows error like Class A is not abstract and abstract method...
Read more >Abstract Methods and Classes (The Java™ Tutorials ...
An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this:.
Read more >Anonymous Classes and Single Abstract Method Types
Scala suppports, similar to Java, a way to define anonymous classes. Let's assume we have an interface.
Read more >Java Abstract Class and Method (With Example) - Programiz
A method that doesn't have its body is known as an abstract method. We use the same abstract keyword to create abstract methods....
Read more >Anonymous class that extends abstract class but does not ...
EPHP Fatal error: Class class@anonymous contains 1 abstract method and must therefore be declared abstract or implement the remaining ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ayazhafiz
Is this really inexpressible in closure? How is it different from the Symbol methods in https://github.com/google/closure-compiler/blob/50713dceb16b369f8f317e5b49e8a9dec2b47496/externs/es6_collections.js
Couldn’t you just do
I tried manually generating this code and the closure compiler seems to accept it. So I think you could fix this in tsickle/src/jsdoc_transformer.ts: If
fnDecl.name.kind == ts.SyntaxKind.ComputedPropertyName
, usets.createElementAccess(instancePropAccess, fnDecl.name.expression)
instead ofts.createPropertyAccess(instancePropAccess, name)