diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-07-01 16:19:34 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-07-07 10:41:11 +0200 |
commit | 14fa7bef120cbb996d042daba6095530167c49ed (patch) | |
tree | 7bb6a7674fb22ff5146eb2ab5c8f6b4d9514d200 /test/files/neg | |
parent | 3f79f8eabfa4c55e167a4ca742fc46106f84b2e1 (diff) | |
download | scala-14fa7bef120cbb996d042daba6095530167c49ed.tar.gz scala-14fa7bef120cbb996d042daba6095530167c49ed.tar.bz2 scala-14fa7bef120cbb996d042daba6095530167c49ed.zip |
SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
When a sealed class or trait has local children, they are not pickled
in as part of the children of the symbol (introduced in 12a2b3b to fix
Aladdin bug 1055). Instead the compiler adds a single child class
named LOCAL_CHILD. The parents of its ClassInfoType were wrong: the
first parent should be a class. For sealed traits, we were using the
trait itself.
Also, the LOCAL_CHILD dummy class was entered as a member of its
enclosing class, which is wrong: it represents a local (non-member)
class, and it's a synthetic dummy anyway.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/aladdin1055.check | 7 | ||||
-rw-r--r-- | test/files/neg/aladdin1055.flags | 1 | ||||
-rw-r--r-- | test/files/neg/aladdin1055/A.scala | 6 | ||||
-rw-r--r-- | test/files/neg/aladdin1055/Test_1.scala | 5 |
4 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/aladdin1055.check b/test/files/neg/aladdin1055.check new file mode 100644 index 0000000000..41782ae987 --- /dev/null +++ b/test/files/neg/aladdin1055.check @@ -0,0 +1,7 @@ +Test_1.scala:2: warning: match may not be exhaustive. +It would fail on the following input: (_ : this.<local child>) + def foo(t: A.T) = t match { + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found diff --git a/test/files/neg/aladdin1055.flags b/test/files/neg/aladdin1055.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/neg/aladdin1055.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/aladdin1055/A.scala b/test/files/neg/aladdin1055/A.scala new file mode 100644 index 0000000000..862336e30c --- /dev/null +++ b/test/files/neg/aladdin1055/A.scala @@ -0,0 +1,6 @@ +object A { + sealed trait T { def f: Int } + class TT extends T { def f = 0 } + + def foo = new T { def f = 1 } // local subclass of sealed trait T +} diff --git a/test/files/neg/aladdin1055/Test_1.scala b/test/files/neg/aladdin1055/Test_1.scala new file mode 100644 index 0000000000..39d9b1dc98 --- /dev/null +++ b/test/files/neg/aladdin1055/Test_1.scala @@ -0,0 +1,5 @@ +object Test { + def foo(t: A.T) = t match { + case a: A.TT => 0 + } +} |