Improve script template not found diagnostics

(preliminary, see also TODO)
This commit is contained in:
Ilya Chernikov
2016-12-01 17:31:15 +01:00
parent c82e91eafe
commit 83420e26b6
@@ -146,6 +146,7 @@ public class ScriptCodegen extends MemberCodegen<KtScript> {
Type classType = typeMapper.mapType(scriptDescriptor);
ClassDescriptor superclass = DescriptorUtilsKt.getSuperClassNotAny(scriptDescriptor);
// TODO: throw if class is not found)
if (superclass == null) {
iv.load(0, classType);
@@ -153,7 +154,7 @@ public class ScriptCodegen extends MemberCodegen<KtScript> {
}
else {
ConstructorDescriptor ctorDesc = superclass.getUnsubstitutedPrimaryConstructor();
assert ctorDesc != null;
if (ctorDesc == null) throw new RuntimeException("Primary constructor not found for script template " + superclass.toString());
iv.load(0, classType);