From 671e6e03c7e096eda0c27262ae8605fa7af76f59 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 12 Sep 2013 13:28:06 -0700 Subject: Corrects behavior of finalResultType. The implementation had come to depend on finalResultType accidentally doing things beyond its charter - in particular, widening types. After hunting down and fixing the call sites depending on the bugs, I was able to rewrite the method to do only what it's supposed to do. I threw in a different way of writing it entirely to suggest how some correctness might be obtained in the future. It's a lot harder for a method written like this to break. --- test/files/run/compiler-asSeenFrom.check | 94 ++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) (limited to 'test/files/run') diff --git a/test/files/run/compiler-asSeenFrom.check b/test/files/run/compiler-asSeenFrom.check index 47d40b0331..7305504115 100644 --- a/test/files/run/compiler-asSeenFrom.check +++ b/test/files/run/compiler-asSeenFrom.check @@ -1,6 +1,54 @@ class C { type seen from prefix is ---- ---------------- -- + C.this.I[Int] C[List[T3]] C[List[T3]]#I[Int] + C.this.I[Int] C[T1] C[T1]#I[Int] + C.this.I[Int] D[A1] D[A1]#I[Int] + C.this.I[Int] D[T3] D[T3]#I[Int] + C.this.I[List[Int]] C[List[T3]] C[List[T3]]#I[List[Int]] + C.this.I[List[Int]] C[T1] C[T1]#I[List[Int]] + C.this.I[List[Int]] D[A1] D[A1]#I[List[Int]] + C.this.I[List[Int]] D[T3] D[T3]#I[List[Int]] + C.this.I[T1] C[List[T3]] C[List[T3]]#I[List[T3]] + C.this.I[T1] C[T1] C[T1]#I[T1] + C.this.I[T1] D[A1] D[A1]#I[A1] + C.this.I[T1] D[T3] D[T3]#I[T3] + C.this.I[T2] C[List[T3]] C[List[T3]]#I[T2] + C.this.I[T2] C[T1] C[T1]#I[T2] + C.this.I[T2] D[A1] D[A1]#I[T2] + C.this.I[T2] D[T3] D[T3]#I[T2] + C.this.I[T3] C[List[T3]] C[List[T3]]#I[T3] + C.this.I[T3] C[T1] C[T1]#I[T3] + C.this.I[T3] D[A1] D[A1]#I[T3] + C.this.I[T3] D[T3] D[T3]#I[T3] + C.this.I[T4] C[List[T3]] C[List[T3]]#I[T4] + C.this.I[T4] C[T1] C[T1]#I[T4] + C.this.I[T4] D[A1] D[A1]#I[T4] + C.this.I[T4] D[T3] D[T3]#I[T4] + C.this.J[Int] C[List[T3]] C[List[T3]]#J[Int] + C.this.J[Int] C[T1] C[T1]#J[Int] + C.this.J[Int] D[A1] D[A1]#J[Int] + C.this.J[Int] D[T3] D[T3]#J[Int] + C.this.J[List[Int]] C[List[T3]] C[List[T3]]#J[List[Int]] + C.this.J[List[Int]] C[T1] C[T1]#J[List[Int]] + C.this.J[List[Int]] D[A1] D[A1]#J[List[Int]] + C.this.J[List[Int]] D[T3] D[T3]#J[List[Int]] + C.this.J[T1] C[List[T3]] C[List[T3]]#J[List[T3]] + C.this.J[T1] C[T1] C[T1]#J[T1] + C.this.J[T1] D[A1] D[A1]#J[A1] + C.this.J[T1] D[T3] D[T3]#J[T3] + C.this.J[T2] C[List[T3]] C[List[T3]]#J[T2] + C.this.J[T2] C[T1] C[T1]#J[T2] + C.this.J[T2] D[A1] D[A1]#J[T2] + C.this.J[T2] D[T3] D[T3]#J[T2] + C.this.J[T3] C[List[T3]] C[List[T3]]#J[T3] + C.this.J[T3] C[T1] C[T1]#J[T3] + C.this.J[T3] D[A1] D[A1]#J[T3] + C.this.J[T3] D[T3] D[T3]#J[T3] + C.this.J[T4] C[List[T3]] C[List[T3]]#J[T4] + C.this.J[T4] C[T1] C[T1]#J[T4] + C.this.J[T4] D[A1] D[A1]#J[T4] + C.this.J[T4] D[T3] D[T3]#J[T4] C[List[T3]]#I[T1] D[A1] C[List[T3]]#I[A1] C[List[T3]]#I[T1] D[T3] C[List[T3]]#I[T3] C[List[T3]]#J[T1] D[A1] C[List[T3]]#J[A1] @@ -49,6 +97,8 @@ class C { class D { type seen from prefix is ---- ---------------- -- + C.this.I[T3] D[A1] C.this.I[A1] + C.this.J[T3] D[A1] C.this.J[A1] C[List[T3]]#I[Int] D[A1] C[List[A1]]#I[Int] C[List[T3]]#I[List[Int]] D[A1] C[List[A1]]#I[List[Int]] C[List[T3]]#I[T1] D[A1] C[List[A1]]#I[T1] @@ -73,6 +123,42 @@ class D { class I { type seen from prefix is ---- ---------------- -- + C.this.I[Int] D.this.J[T4] D.this.cD.I[Int] + C.this.I[Int] Z.dZ.J[A2] Z.dZ.cD.I[Int] + C.this.I[Int] Z.dZ.J[P] Z.dZ.cD.I[Int] + C.this.I[List[Int]] D.this.J[T4] D.this.cD.I[List[Int]] + C.this.I[List[Int]] Z.dZ.J[A2] Z.dZ.cD.I[List[Int]] + C.this.I[List[Int]] Z.dZ.J[P] Z.dZ.cD.I[List[Int]] + C.this.I[T1] D.this.J[T4] D.this.cD.I[List[T3]] + C.this.I[T1] Z.dZ.J[A2] Z.dZ.cD.I[List[A1]] + C.this.I[T1] Z.dZ.J[P] Z.dZ.cD.I[List[A1]] + C.this.I[T2] D.this.J[T4] D.this.cD.I[T4] + C.this.I[T2] Z.dZ.J[A2] Z.dZ.cD.I[A2] + C.this.I[T2] Z.dZ.J[P] Z.dZ.cD.I[P] + C.this.I[T3] D.this.J[T4] D.this.cD.I[T3] + C.this.I[T3] Z.dZ.J[A2] Z.dZ.cD.I[T3] + C.this.I[T3] Z.dZ.J[P] Z.dZ.cD.I[T3] + C.this.I[T4] D.this.J[T4] D.this.cD.I[T4] + C.this.I[T4] Z.dZ.J[A2] Z.dZ.cD.I[T4] + C.this.I[T4] Z.dZ.J[P] Z.dZ.cD.I[T4] + C.this.J[Int] D.this.J[T4] D.this.cD.J[Int] + C.this.J[Int] Z.dZ.J[A2] Z.dZ.cD.J[Int] + C.this.J[Int] Z.dZ.J[P] Z.dZ.cD.J[Int] + C.this.J[List[Int]] D.this.J[T4] D.this.cD.J[List[Int]] + C.this.J[List[Int]] Z.dZ.J[A2] Z.dZ.cD.J[List[Int]] + C.this.J[List[Int]] Z.dZ.J[P] Z.dZ.cD.J[List[Int]] + C.this.J[T1] D.this.J[T4] D.this.cD.J[List[T3]] + C.this.J[T1] Z.dZ.J[A2] Z.dZ.cD.J[List[A1]] + C.this.J[T1] Z.dZ.J[P] Z.dZ.cD.J[List[A1]] + C.this.J[T2] D.this.J[T4] D.this.cD.J[T4] + C.this.J[T2] Z.dZ.J[A2] Z.dZ.cD.J[A2] + C.this.J[T2] Z.dZ.J[P] Z.dZ.cD.J[P] + C.this.J[T3] D.this.J[T4] D.this.cD.J[T3] + C.this.J[T3] Z.dZ.J[A2] Z.dZ.cD.J[T3] + C.this.J[T3] Z.dZ.J[P] Z.dZ.cD.J[T3] + C.this.J[T4] D.this.J[T4] D.this.cD.J[T4] + C.this.J[T4] Z.dZ.J[A2] Z.dZ.cD.J[T4] + C.this.J[T4] Z.dZ.J[P] Z.dZ.cD.J[T4] C[List[T3]]#I[T1] D.this.J[T4] C[List[T3]]#I[List[T3]] C[List[T3]]#I[T1] Z.dZ.J[A2] C[List[T3]]#I[List[A1]] C[List[T3]]#I[T1] Z.dZ.J[P] C[List[T3]]#I[List[A1]] @@ -137,6 +223,14 @@ class I { class J { type seen from prefix is ---- ---------------- -- + C.this.I[T3] Z.dZ.J[A2] C.this.I[A1] + C.this.I[T3] Z.dZ.J[P] C.this.I[A1] + C.this.I[T4] Z.dZ.J[A2] C.this.I[A2] + C.this.I[T4] Z.dZ.J[P] C.this.I[P] + C.this.J[T3] Z.dZ.J[A2] C.this.J[A1] + C.this.J[T3] Z.dZ.J[P] C.this.J[A1] + C.this.J[T4] Z.dZ.J[A2] C.this.J[A2] + C.this.J[T4] Z.dZ.J[P] C.this.J[P] C[List[T3]]#I[Int] Z.dZ.J[A2] C[List[A1]]#I[Int] C[List[T3]]#I[Int] Z.dZ.J[P] C[List[A1]]#I[Int] C[List[T3]]#I[List[Int]] Z.dZ.J[A2] C[List[A1]]#I[List[Int]] -- cgit v1.2.3