From 8206e26f7b04b028b6a81cf7008d9b49169341fd Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 12 Feb 2013 12:32:20 +0100 Subject: Fix typing idempotency bug with Annotated trees typedAnnotated transforms an Annotated tree into a Typed tree. The original field of the result is set to the Annotated tree. The bug was that typedAnnotated was using the untyped Annotated tree as original, but also set its type. When re-typing later on the same Annotated tree, the typer would consider it as alreadyTyped. This is incorrect, the typer needs to convert Annotated trees to Typed. Also, the Annotated tree only had its type field set, but its children were still untyped. This crashed the compiler lateron, non-typed trees would get out of the typing phase. --- test/files/run/annotatedRetyping.check | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/files/run/annotatedRetyping.check (limited to 'test/files/run/annotatedRetyping.check') diff --git a/test/files/run/annotatedRetyping.check b/test/files/run/annotatedRetyping.check new file mode 100644 index 0000000000..b296a80526 --- /dev/null +++ b/test/files/run/annotatedRetyping.check @@ -0,0 +1,6 @@ +typing List(1, 2).map(((x) => { + val another = scala.Tuple2(t.nt, t.tr): @testAnn match { + case scala.Tuple2(_, _) => 1 + }; + x +})) -- cgit v1.2.3