Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Auto-fetch in (unbox) to reduce boilerplace a bit

  • Loading branch information...
commit 51face190e9bd9dd037ca879f31cf777f8aa4f32 1 parent 025a6e6
Stefan O'Rear authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/CodeGen.cs
2  lib/CodeGen.cs
View
@@ -2693,6 +2693,8 @@ class NamProcessor {
handlers["unbox"] = delegate(NamProcessor th, object[] zyg) {
Type t = namtype(zyg[1]);
CpsOp unboxee = th.Scan(zyg[2]);
+ if (unboxee.head.Returns == Tokens.Variable)
+ unboxee = CpsOp.MethodCall(Tokens.Variable_Fetch, unboxee);
return CpsOp.MethodCall(Tokens.Kernel.GetMethod("UnboxAny").MakeGenericMethod(t), unboxee);
};
handlers["newboundvar"] = delegate(NamProcessor th, object[] zyg) {
Please sign in to comment.
Something went wrong with that request. Please try again.