@@ -4875,17 +4875,16 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
48754875 dyna.wrapErrors(t, (_.typed1(t, mode, pt)))
48764876 }
48774877
4878- val sym = tree.symbol orElse member(qual, name) orElse inCompanionForJavaStatic(qual.tpe.prefix, qual.symbol, name) orElse {
4878+ val sym = tree.symbol orElse member(qual, name) orElse inCompanionForJavaStatic(qual.tpe.prefix, qual.symbol, name)
4879+ if ((sym eq NoSymbol ) && name != nme.CONSTRUCTOR && mode.inAny(EXPRmode | PATTERNmode )) {
48794880 // symbol not found? --> try to convert implicitly to a type that does have the required
48804881 // member. Added `| PATTERNmode` to allow enrichment in patterns (so we can add e.g., an
48814882 // xml member to StringContext, which in turn has an unapply[Seq] method)
4882- if (name != nme.CONSTRUCTOR && mode.inAny(EXPRmode | PATTERNmode )) {
4883- val qual1 = adaptToMemberWithArgs(tree, qual, name, mode)
4884- if ((qual1 ne qual) && ! qual1.isErrorTyped)
4885- return typed(treeCopy.Select (tree, qual1, name), mode, pt)
4886- }
4887- NoSymbol
4883+ val qual1 = adaptToMemberWithArgs(tree, qual, name, mode)
4884+ if ((qual1 ne qual) && ! qual1.isErrorTyped)
4885+ return typed(treeCopy.Select (tree, qual1, name), mode, pt)
48884886 }
4887+
48894888 if (phase.erasedTypes && qual.isInstanceOf [Super ] && tree.symbol != NoSymbol )
48904889 qual setType tree.symbol.owner.tpe
48914890
0 commit comments