浏览代码

use standard name for captured `this`

closes #11
Simon Krajewski 5 月之前
父节点
当前提交
9e60f0ece1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/coro/coro.ml

+ 1 - 1
src/coro/coro.ml

@@ -206,7 +206,7 @@ module ContinuationClassBuilder = struct
 		let ethis       = mk (TConst TThis) coro_class.inside.cls_t null_pos in
 		let ethis       = mk (TConst TThis) coro_class.inside.cls_t null_pos in
 
 
 		(* Create a custom this variable to be captured, should the compiler already handle this? *)
 		(* Create a custom this variable to be captured, should the compiler already handle this? *)
-		let vfakethis    = alloc_var VGenerated "fakethis" coro_class.inside.cls_t null_pos in
+		let vfakethis    = alloc_var VGenerated (Printf.sprintf "%sthis" gen_local_prefix) coro_class.inside.cls_t null_pos in
 		let evarfakethis = mk (TVar (vfakethis, Some ethis)) coro_class.inside.cls_t null_pos in
 		let evarfakethis = mk (TVar (vfakethis, Some ethis)) coro_class.inside.cls_t null_pos in
 
 
 		let this_field cf =
 		let this_field cf =