summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-08-21 12:18:09 +0200
committerPaul Phillips <paulp@improving.org>2012-09-01 10:02:22 -0700
commit6cda8a6f972d014f9b73c54a43bb80f99b64adb4 (patch)
treee01065cc5dba939979139d114f79cdeed21d391e /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentd9c0cb6165bd60d79bdf764291c417c86623b042 (diff)
downloadscala-6cda8a6f972d014f9b73c54a43bb80f99b64adb4.tar.gz
scala-6cda8a6f972d014f9b73c54a43bb80f99b64adb4.tar.bz2
scala-6cda8a6f972d014f9b73c54a43bb80f99b64adb4.zip
Fix for SI-6263, futile adaptation.
Don't try to implicitly convert an unstable prefix to a stable one by applying a view. As the matrix spoon kid says, "that's impossible."
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f6baf02c3e..b6dab13111 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -233,10 +233,11 @@ trait Typers extends Modes with Adaptations with Tags {
* @param tree ...
* @return ...
*/
- def checkStable(tree: Tree): Tree =
+ def checkStable(tree: Tree): Tree = (
if (treeInfo.isExprSafeToInline(tree)) tree
else if (tree.isErrorTyped) tree
else UnstableTreeError(tree)
+ )
/** Would tree be a stable (i.e. a pure expression) if the type
* of its symbol was not volatile?
@@ -5201,7 +5202,10 @@ trait Typers extends Modes with Adaptations with Tags {
def typedSingletonTypeTree(tree: SingletonTypeTree) = {
val ref1 = checkStable(
- typed(tree.ref, EXPRmode | QUALmode | (mode & TYPEPATmode), AnyRefClass.tpe))
+ context.withImplicitsDisabled(
+ typed(tree.ref, EXPRmode | QUALmode | (mode & TYPEPATmode), AnyRefClass.tpe)
+ )
+ )
tree setType ref1.tpe.resultType
}