closes #7972
@@ -150,7 +150,7 @@ module ExprPreprocessing = struct
in
let rec map e = match fst e with
| ESwitch(e1,cases,def) when is_annotated (pos e) ->
- let e1 = loop e1 in
+ let e1 = map e1 in
let cases = List.map (fun (el,eg,e,p) ->
let old = !in_pattern in
in_pattern := true;
@@ -0,0 +1,20 @@
+package cases;
+
+class Issue7972 extends DisplayTestCase {
+ /**
+ class Main {
+ static function main() {
+ var foo = 0.0;
+ switch (S{-1-}td.i{-2-}nt(fo{-3-}o)) {
+ case _:
+ }
+ **/
+ function test() {
+ eq("Class<Std>", type(pos(1)));
+ eq("(x : Float) -> Int", type(pos(2)));
+ eq("Float", type(pos(3)));
+}