Fix ClassBuilder's getConstructor() when super class is extern
Handle super class constructor's expr being `null`, which happens when the super class is an extern with a constructor definition.
This commit is contained in:
@@ -63,7 +63,9 @@ class ClassBuilder {
|
|||||||
if (cl.constructor != null) {
|
if (cl.constructor != null) {
|
||||||
try {
|
try {
|
||||||
var ctor = cl.constructor.get();
|
var ctor = cl.constructor.get();
|
||||||
var func = Context.getTypedExpr(ctor.expr()).getFunction().sure();
|
var ctorExpr = ctor.expr();
|
||||||
|
if (ctorExpr == null) throw 'Super constructor has no expression';
|
||||||
|
var func = Context.getTypedExpr(ctorExpr).getFunction().sure();
|
||||||
|
|
||||||
for (arg in func.args) //this is to deal with type parameter substitutions
|
for (arg in func.args) //this is to deal with type parameter substitutions
|
||||||
arg.type = null;
|
arg.type = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user