@@ -4926,17 +4926,16 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
4926
4926
dyna.wrapErrors(t, (_.typed1(t, mode, pt)))
4927
4927
}
4928
4928
4929
- val sym = tree.symbol orElse member(qual, name) orElse inCompanionForJavaStatic(qual.tpe.prefix, qual.symbol, name) orElse {
4929
+ val sym = tree.symbol orElse member(qual, name) orElse inCompanionForJavaStatic(qual.tpe.prefix, qual.symbol, name)
4930
+ if ((sym eq NoSymbol ) && name != nme.CONSTRUCTOR && mode.inAny(EXPRmode | PATTERNmode )) {
4930
4931
// symbol not found? --> try to convert implicitly to a type that does have the required
4931
4932
// member. Added `| PATTERNmode` to allow enrichment in patterns (so we can add e.g., an
4932
4933
// xml member to StringContext, which in turn has an unapply[Seq] method)
4933
- if (name != nme.CONSTRUCTOR && mode.inAny(EXPRmode | PATTERNmode )) {
4934
- val qual1 = adaptToMemberWithArgs(tree, qual, name, mode)
4935
- if ((qual1 ne qual) && ! qual1.isErrorTyped)
4936
- return typed(treeCopy.Select (tree, qual1, name), mode, pt)
4937
- }
4938
- NoSymbol
4934
+ val qual1 = adaptToMemberWithArgs(tree, qual, name, mode)
4935
+ if ((qual1 ne qual) && ! qual1.isErrorTyped)
4936
+ return typed(treeCopy.Select (tree, qual1, name), mode, pt)
4939
4937
}
4938
+
4940
4939
if (phase.erasedTypes && qual.isInstanceOf [Super ] && tree.symbol != NoSymbol )
4941
4940
qual setType tree.symbol.owner.tpe
4942
4941
0 commit comments