@@ -4875,17 +4875,16 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
4875
4875
dyna.wrapErrors(t, (_.typed1(t, mode, pt)))
4876
4876
}
4877
4877
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 )) {
4879
4880
// symbol not found? --> try to convert implicitly to a type that does have the required
4880
4881
// member. Added `| PATTERNmode` to allow enrichment in patterns (so we can add e.g., an
4881
4882
// 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)
4888
4886
}
4887
+
4889
4888
if (phase.erasedTypes && qual.isInstanceOf [Super ] && tree.symbol != NoSymbol )
4890
4889
qual setType tree.symbol.owner.tpe
4891
4890
0 commit comments