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