Skip to content

Commit

Permalink
Auto-fetch in (unbox) to reduce boilerplace a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 19, 2012
1 parent 025a6e6 commit 51face1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/CodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,8 @@ static 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) {
Expand Down

0 comments on commit 51face1

Please sign in to comment.