diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-09 19:40:29 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-12-12 10:57:48 -0800 |
commit | b26f12d4b116799e8860ddfd27ad398bc0c80b6a (patch) | |
tree | 5e28f7103b20dc3a15df91674084923d14ebca3b /test/files/run/t0091.scala | |
parent | 00eb7af51d446b3e6aa963ad14b2a4d93dd4c69c (diff) | |
download | scala-b26f12d4b116799e8860ddfd27ad398bc0c80b6a.tar.gz scala-b26f12d4b116799e8860ddfd27ad398bc0c80b6a.tar.bz2 scala-b26f12d4b116799e8860ddfd27ad398bc0c80b6a.zip |
Cleanup in module var creation.
When all the logic in a method is for symbol creation,
and then at the last minute it throws on a hastily zipped
ValDef, it's really not a tree generation method, it's a
symbol creation method.
Eliminated redundancy and overgeneralization; marked some
bits for further de-duplication. Did my best with my limited
archeological skills to document what is supposed to be
happening in eliminateModuleDefs.
Diffstat (limited to 'test/files/run/t0091.scala')
-rw-r--r-- | test/files/run/t0091.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/files/run/t0091.scala b/test/files/run/t0091.scala index eaddde0dbf..45235eb77b 100644 --- a/test/files/run/t0091.scala +++ b/test/files/run/t0091.scala @@ -4,10 +4,13 @@ object C extends B { object m extends A { def x = 5 } } object Test { - // The type annotation here is necessary, otherwise - // the compiler would reference C$m$ directly. - def o : B = C - def main(argv : Array[String]) : Unit = { - println(o.m.x) - } + // The type annotation here is necessary, otherwise + // the compiler would reference C$m$ directly. + def o1 : B = C + def o2 = C + + def main(argv : Array[String]) : Unit = { + println(o1.m.x) + println(o2.m.x) + } } |