summaryrefslogtreecommitdiff
path: root/test/files/run/t6439.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-25 14:15:45 -0800
committerPaul Phillips <paulp@improving.org>2013-01-25 16:28:44 -0800
commitf3ac123f345b095580d1839e0f67ea07c6837946 (patch)
tree10322987043f41284f35da1d9a349e01179fcccb /test/files/run/t6439.scala
parentf01af109ae975461fe5a3120a69814521968fcce (diff)
parentac432bcde6b357194203d25df5f204ab8e426416 (diff)
downloadscala-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.scala')
-rw-r--r--test/files/run/t6439.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/files/run/t6439.scala b/test/files/run/t6439.scala
new file mode 100644
index 0000000000..175a1d134f
--- /dev/null
+++ b/test/files/run/t6439.scala
@@ -0,0 +1,32 @@
+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
+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
+}
+lookup("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols
+ """
+}