File tree 1 file changed +8
-7
lines changed
compiler/src/dotty/tools/dotc/typer 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,15 @@ trait TypeAssigner {
117
117
118
118
/** The type of the selection `tree`, where `qual1` is the typed qualifier part. */
119
119
def selectionType (tree : untpd.RefTree , qual1 : Tree )(using Context ): Type =
120
- var qualType = qual1.tpe.widenIfUnstable
121
- if ! qualType.isError then
122
- val prevQual = qualType
123
- if ! qualType.hasSimpleKind && tree.name != nme.CONSTRUCTOR then
120
+ val qualType0 = qual1.tpe.widenIfUnstable
121
+ val qualType =
122
+ if ! qualType0.hasSimpleKind && tree.name != nme.CONSTRUCTOR then
124
123
// constructors are selected on typeconstructor, type arguments are passed afterwards
125
- qualType = errorType(em " $prevQual takes type parameters " , qual1.srcPos)
126
- else if ! qualType.isInstanceOf [TermType ] then
127
- qualType = errorType(em " $prevQual is illegal as a selection prefix " , qual1.srcPos)
124
+ errorType(em " $qualType0 takes type parameters " , qual1.srcPos)
125
+ else if ! qualType0.isInstanceOf [TermType ] && ! qualType0.isError then
126
+ errorType(em " $qualType0 is illegal as a selection prefix " , qual1.srcPos)
127
+ else
128
+ qualType0
128
129
129
130
def arrayElemType = qual1.tpe.widen match
130
131
case JavaArrayType (elemtp) => elemtp
You can’t perform that action at this time.
0 commit comments