assemblyscript
assemblyscript copied to clipboard
The bug for `implements` interface and `extends` class when meet same function name
Bug description
export interface CoreVisitor<T> {
visitBool(v: boolean): T;
}
class A implements CoreVisitor<string>, CoreVisitor<boolean> {
// @ts-ignore
visitBool(v: boolean): string {
throw new Error("Method not implemented.");
}
}
let a: A = new A();
// Or the following code
abstract class Foo {
abstract visitBool(v: boolean): string;
}
export interface CoreVisitor<T> {
visitBool(v: boolean): T;
}
class A extends Foo implements CoreVisitor<boolean> {
// @ts-ignore
visitBool(v: boolean): string {
throw new Error("Method not implemented.");
}
}
// Or
abstract class Bar<T> {
abstract visitBool(v: boolean): T;
}
export interface CoreVisitor<T> {
visitBool(v: boolean): T;
}
class A extends Bar<string> implements CoreVisitor<boolean> {
// @ts-ignore
visitBool(v: boolean): string {
throw new Error("Method not implemented.");
}
}
This code should report compile error.
Steps to reproduce
AssemblyScript version
v0.27