Skip to content

Commit

Permalink
Don't add unnecessary abstract classes to dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Jul 4, 2023
1 parent 8c2f068 commit fe74229
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev/src/lobster/typecheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,12 @@ struct TypeChecker {
break;
}
}
if (udt.g.is_abstract) {
// Only necessary to add itself, but not to superclasses.
// FIXME: if we could separate the concept of dispatch_root and subudts,
// we wouldn't even need to add the root.
break;
}
}
if (!udt.ComputeSizes()) {
Error(errn, cat("struct ", Q(udt.name), " cannot be self-referential"));
Expand Down

0 comments on commit fe74229

Please sign in to comment.