@@ -228,7 +228,7 @@ module Pattern = struct
let handle_ident s p =
let save =
let old = ctx.locals in
- ctx.locals <- PMap.empty;
+ ctx.locals <- (try PMap.add "this" (PMap.find "this" old) PMap.empty with Not_found -> PMap.empty);
(fun () ->
ctx.locals <- old;
)
@@ -0,0 +1,16 @@
+package unit.issues;
+
+private abstract A(Int) from Int {
+ public function size() {
+ return switch (this) {
+ case size: size;
+ }
+}
+class Issue5392 extends unit.Test {
+ function test() {
+ var a = (10 : A);
+ eq(10, a.size());