File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -233,10 +233,11 @@ trait Typers extends Modes with Adaptations with Tags {
233233 * @param tree ...
234234 * @return ...
235235 */
236- def checkStable (tree : Tree ): Tree =
236+ def checkStable (tree : Tree ): Tree = (
237237 if (treeInfo.isExprSafeToInline(tree)) tree
238238 else if (tree.isErrorTyped) tree
239239 else UnstableTreeError (tree)
240+ )
240241
241242 /** Would tree be a stable (i.e. a pure expression) if the type
242243 * of its symbol was not volatile?
@@ -5201,7 +5202,10 @@ trait Typers extends Modes with Adaptations with Tags {
52015202
52025203 def typedSingletonTypeTree (tree : SingletonTypeTree ) = {
52035204 val ref1 = checkStable(
5204- typed(tree.ref, EXPRmode | QUALmode | (mode & TYPEPATmode ), AnyRefClass .tpe))
5205+ context.withImplicitsDisabled(
5206+ typed(tree.ref, EXPRmode | QUALmode | (mode & TYPEPATmode ), AnyRefClass .tpe)
5207+ )
5208+ )
52055209 tree setType ref1.tpe.resultType
52065210 }
52075211
Original file line number Diff line number Diff line change 1+ t6263.scala:5: error: type mismatch;
2+ found : A.this.c.type (with underlying type C)
3+ required: AnyRef
4+ type t = c.type
5+ ^
6+ one error found
Original file line number Diff line number Diff line change 1+ class C (val a : Any ) extends AnyVal
2+ class A {
3+ implicit def c2AnyRef (c : C ): AnyRef = new {}
4+ val c = new C (0 )
5+ type t = c.type
6+ }
You can’t perform that action at this time.
0 commit comments