File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1060,13 +1060,14 @@ trait Applications extends Compatibility {
10601060 tree
10611061 }
10621062
1063- /** Does `state` contain a single "NotAMember" or "MissingIdent" message as
1064- * pending error message that says `$memberName is not a member of ...` or
1065- * `Not found: $memberName`? If memberName is empty, any name will do.
1063+ /** Does `state` contain a "NotAMember" or "MissingIdent" message as
1064+ * first pending error message? That message would be
1065+ * `$memberName is not a member of ...` or `Not found: $memberName`.
1066+ * If memberName is empty, any name will do.
10661067 */
10671068 def saysNotFound (state : TyperState , memberName : Name )(using Context ): Boolean =
10681069 state.reporter.pendingMessages match
1069- case dia :: Nil =>
1070+ case dia :: _ =>
10701071 dia.msg match
10711072 case msg : NotFoundMsg => memberName.isEmpty || msg.name == memberName
10721073 case _ => false
Original file line number Diff line number Diff line change @@ -490,11 +490,11 @@ class Typer extends Namer
490490 case _ => app
491491 }
492492 case qual =>
493- if (tree.name.isTypeName) checkStable(qual.tpe, qual.sourcePos, " type prefix" )
494493 val select = assignType(cpy.Select (tree)(qual, tree.name), qual)
495-
496494 val select1 = toNotNullTermRef(select, pt)
497495
496+ if (tree.name.isTypeName) checkStable(qual.tpe, qual.sourcePos, " type prefix" )
497+
498498 if (select1.tpe ne TryDynamicCallType ) ConstFold (checkStableIdentPattern(select1, pt))
499499 else if (pt.isInstanceOf [FunOrPolyProto ] || pt == AssignProto ) select1
500500 else typedDynamicSelect(tree, Nil , pt)
Original file line number Diff line number Diff line change 1+ -- [E008] Not Found Error: tests/neg/i8632.scala:2:15 ------------------------------------------------------------------
2+ 2 | Nil.toString.foo(1) // error
3+ | ^^^^^^^^^^^^^^^^
4+ | value foo is not a member of String
Original file line number Diff line number Diff line change 1+ object Test {
2+ Nil .toString.foo(1 ) // error
3+ }
You can’t perform that action at this time.
0 commit comments