Open
Description
class Parent {}
const Obj = {};
Obj.Alias = Parent;
class Child extends Obj.Alias {} // Bad type annotation. Unknown type Obj.Alias
The error here stems from the @extends {Obj.Alias}
in the transpiled code.
This causes a bug in ES6 module rewriting. If a class is exported directly then things are fine:
export class Parent {
static staticFunction() { return 'Parent.staticFunction'; }
}
import { Parent } from './input0';
class Child extends Parent {}
Note the type annotation of the extends ends up being Parent$$module$input0.
But if we export using export specs there's an error.
class Parent {
static staticFunction() { return 'Parent.staticFunction'; }
}
export { Parent };
import { Parent } from './input0';
class Child extends Parent {} // Bad type annotation. Unknown type module$input0.Parent
Note the type annotation is now module$input0.Parent.
Appears to be an OTI only bug, but seems pretty important.