diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-25 14:15:45 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-25 16:28:44 -0800 |
commit | f3ac123f345b095580d1839e0f67ea07c6837946 (patch) | |
tree | 10322987043f41284f35da1d9a349e01179fcccb /test/files/run/t6439.check | |
parent | f01af109ae975461fe5a3120a69814521968fcce (diff) | |
parent | ac432bcde6b357194203d25df5f204ab8e426416 (diff) | |
download | scala-f3ac123f345b095580d1839e0f67ea07c6837946.tar.gz scala-f3ac123f345b095580d1839e0f67ea07c6837946.tar.bz2 scala-f3ac123f345b095580d1839e0f67ea07c6837946.zip |
Merge commit 'ac432bcde6' into pr/merge-2.10
* commit 'ac432bcde6':
Fix broken build.
SI-6434 Pretty print function types with by name arg as (=> A) => B
Removed class files.
SI-6994 Avoid spurious promiscuous catch warning
Addressing warnings.
SI-6439 Avoid spurious REPL warnings about companionship
use ArrayBuffer instead of Array to build Formulae
SI-6942 more efficient unreachability analysis
use Constant::isIntRange even if it's NIH
SI-6956 determine switchability by type, not tree
SI-5568 Comment improvements for getClass on primitive intersection.
SI-5568 Fixes verify error from getClass on refinement of value type
SI-6923 Context now buffers warnings as well as errors
Conflicts:
src/compiler/scala/tools/nsc/interpreter/IMain.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
test/files/neg/t4851.check
Note:
This merge excludes b07228aebe7a as it breaks master.
Diffstat (limited to 'test/files/run/t6439.check')
-rw-r--r-- | test/files/run/t6439.check | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/test/files/run/t6439.check b/test/files/run/t6439.check new file mode 100644 index 0000000000..3f5f7dc8a4 --- /dev/null +++ b/test/files/run/t6439.check @@ -0,0 +1,77 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> class A +defined class A + +scala> object A // warn +defined object A +warning: previously defined class A is not a companion to object A. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> trait B +defined trait B + +scala> object B // warn +defined object B +warning: previously defined trait B is not a companion to object B. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> object C +defined object C + +scala> object Bippy +defined object Bippy + +scala> class C // warn +defined class C +warning: previously defined object C is not a companion to class C. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> class D +defined class D + +scala> def D = 0 // no warn +D: Int + +scala> val D = 0 // no warn +D: Int = 0 + +scala> object E +defined object E + +scala> var E = 0 // no warn +E: Int = 0 + +scala> object F +defined object F + +scala> type F = Int // no warn +defined type alias F + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power.<tab> ** + +scala> object lookup { + import intp._ + def apply(name: String): Symbol = types(name) orElse terms(name) + def types(name: String): Symbol = replScope lookup (name: TypeName) orElse getClassIfDefined(name) + def terms(name: String): Symbol = replScope lookup (name: TermName) orElse getModuleIfDefined(name) + def types[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol + def terms[T: global.TypeTag] : Symbol = typeOf[T].termSymbol + def apply[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol +} +defined object lookup + +scala> lookup("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols +res0: $r.intp.global.Symbol = type F + +scala> + +scala> |