summaryrefslogtreecommitdiff
path: root/test/files/pos/private-types-after-typer.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-12 13:28:06 -0700
committerPaul Phillips <paulp@improving.org>2013-09-13 02:42:37 -0700
commit671e6e03c7e096eda0c27262ae8605fa7af76f59 (patch)
treeb415fb7915ec80503605387b6ccd2ab29d9887a2 /test/files/pos/private-types-after-typer.scala
parent33a819f61b8b9c19708e8ae22bf25adf6cc7ac24 (diff)
downloadscala-671e6e03c7e096eda0c27262ae8605fa7af76f59.tar.gz
scala-671e6e03c7e096eda0c27262ae8605fa7af76f59.tar.bz2
scala-671e6e03c7e096eda0c27262ae8605fa7af76f59.zip
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.
Diffstat (limited to 'test/files/pos/private-types-after-typer.scala')
-rw-r--r--test/files/pos/private-types-after-typer.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/pos/private-types-after-typer.scala b/test/files/pos/private-types-after-typer.scala
new file mode 100644
index 0000000000..79ef934063
--- /dev/null
+++ b/test/files/pos/private-types-after-typer.scala
@@ -0,0 +1,9 @@
+// Testing that the type of the outer accessor in O2
+// doesn't crash the compiler over private type escaping scope.
+trait T {
+ class C {
+ private object O1 {
+ object O2
+ }
+ }
+} \ No newline at end of file