summaryrefslogtreecommitdiff
path: root/test/files/run/annotatedRetyping.check
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2013-02-12 12:32:20 +0100
committerLukas Rytz <lukas.rytz@epfl.ch>2013-02-12 14:25:24 +0100
commit8206e26f7b04b028b6a81cf7008d9b49169341fd (patch)
treeb9dec24a2a091e25058ce277b0bca73e35a3c7df /test/files/run/annotatedRetyping.check
parentf51ed74aa3aa142c8aa9d5f9d03e0c244737f66e (diff)
downloadscala-8206e26f7b04b028b6a81cf7008d9b49169341fd.tar.gz
scala-8206e26f7b04b028b6a81cf7008d9b49169341fd.tar.bz2
scala-8206e26f7b04b028b6a81cf7008d9b49169341fd.zip
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.
Diffstat (limited to 'test/files/run/annotatedRetyping.check')
-rw-r--r--test/files/run/annotatedRetyping.check6
1 files changed, 6 insertions, 0 deletions
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
+}))