diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-19 13:01:31 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-19 13:01:31 +0100 |
commit | 3486d47508686e4b96560e176280fa9fc536fd41 (patch) | |
tree | 399425abd04da5981d0ffe6000c6414e3027e43e /test/files/run/t6439.scala | |
parent | 6f72ed85c3882d2a8c824a41e6e42d7f33b8d1d6 (diff) | |
download | scala-3486d47508686e4b96560e176280fa9fc536fd41.tar.gz scala-3486d47508686e4b96560e176280fa9fc536fd41.tar.bz2 scala-3486d47508686e4b96560e176280fa9fc536fd41.zip |
SI-6439 Avoid spurious REPL warnings about companionship
`val m` isn't a companion of `trait m`, check the pair of
eponymous symbols are a ((class|trait), object) pair before
emitting the warning.
In order to correctly check this one a type alias is involved,
`definedSymbols` must avoid normalizing through type aliases.
AFAICT this is an improvement to the other clients of that Map,
one such power mode progression is demonstrated at the end
of the test case.
Diffstat (limited to 'test/files/run/t6439.scala')
-rw-r--r-- | test/files/run/t6439.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/t6439.scala b/test/files/run/t6439.scala new file mode 100644 index 0000000000..70a2dbafaf --- /dev/null +++ b/test/files/run/t6439.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +class A +object A // warn +trait B +object B // warn +object C +object Bippy +class C // warn +class D +def D = 0 // no warn +val D = 0 // no warn +object E +var E = 0 // no warn +object F +type F = Int // no warn +:power +intp("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols + """ +} |