Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6947,6 +6947,8 @@ export class Compiler extends DiagnosticEmitter {
// Wouldn't be here if there wasn't at least one overload
var overloadPrototypes = assert(instance.prototype.overloads);

assert(instance.parent.kind == ElementKind.CLASS || instance.parent.kind == ElementKind.INTERFACE);
var parentClassInstance = <Class>instance.parent;
var module = this.module;
var usizeType = this.options.usizeType;
var sizeTypeRef = usizeType.toRef();
Expand Down Expand Up @@ -6992,6 +6994,8 @@ export class Compiler extends DiagnosticEmitter {
if (classInstances) {
for (let _values = Map_values(classInstances), j = 0, l = _values.length; j < l; ++j) {
let classInstance = _values[j];
// Chcek if the parent class is a subtype of instance's class
if (!classInstance.isAssignableTo(parentClassInstance)) continue;
let overloadInstance: Function | null;
if (isProperty) {
let boundProperty = assert(classInstance.members!.get(unboundOverloadParent.name));
Expand Down
5 changes: 5 additions & 0 deletions tests/compiler/class-overloading-cast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"asc_flags": [
"--explicitStart"
]
}
Loading