You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import "allocator/arena";
interface Car{
getBrand():string;
}
export class Audi implements Car{
getBrand():string{
return "audi";
}
}
let audi = new Audi();
When I compile using asc, it throw exception:
ERROR TS2391: Function implementation is missing or not immediately following the declaration.
getBrand():string;
~~~~~~
in test_impl.ts(5,12)
ERROR: Parse error
at Object.main (/Users/Peng/GitHub/assemblyscript/cli/asc.js:377:23)
at Object.<anonymous> (/Users/Peng/GitHub/assemblyscript/bin/asc:3:60)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:575:3)
If I change the getBrand():string; to getBrand():string{};, it compiles fine.
It looks FunctionPrototype not finished.
/** A yet unresolved function prototype. */
export class FunctionPrototype extends Element {
I want to contribute some code, what shall I do?
The text was updated successfully, but these errors were encountered:
There are no plans to support interfaces just now because implementing these properly requires support for virtual methods (virtual lookup tables etc. etc.), and the plan currently is to wait for the GC spec to land instead of rolling our own, possibly large, runtime. GC is tracked here: #89
From a quick test it seems that the specific error has been fixed meanwhile, resulting in a "Not implemented" warning on "implements Car". Still not working, ofc, but the warning is intended and not a bug anymore. Hence closing, but feel free to reopen if there's still something exploding :)
The code:
When I compile using asc, it throw exception:
If I change the
getBrand():string;
togetBrand():string{};
, it compiles fine.It looks FunctionPrototype not finished.
I want to contribute some code, what shall I do?
The text was updated successfully, but these errors were encountered: