Permalink
Browse files

Do not NRE when calling (necessarily nonexistant) methods on a packag…

…e or unfinished class (fixes #125)
  • Loading branch information...
1 parent 3bb38e5 commit 124199cecd2d0b56d907835ad9f1d844498377db @sorear committed May 25, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 lib/CodeGen.cs
  2. +1 −1 lib/ObjModel.cs
View
@@ -4358,6 +4358,8 @@ public class DowncallReceiver : CallReceiver {
// to call methods on the type in the process of defining the
// type itself.
nst.mo.superclasses.Clear();
+ // OTOH, it needs call structures set up to avoid internal errors
+ nst.mo.Revalidate();
if (nst.typeObject == null) // AnyMO.typeObject is set up early
nst.typeObject = new P6opaque(nst, 0);
((P6opaque)nst.typeObject).slots = null;
View
@@ -18,7 +18,7 @@ public abstract class P6any: IFreeze {
}
protected Frame Fail(Frame caller, string msg) {
- return Kernel.Die(caller, msg + " in class " + mo.name);
+ return Kernel.Die(caller, msg + " in type " + mo.name);
}
public abstract string ReprName();

0 comments on commit 124199c

Please sign in to comment.