File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,15 @@ trait TypeAssigner {
117117
118118 /** The type of the selection `tree`, where `qual1` is the typed qualifier part. */
119119 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
124123 // 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
128129
129130 def arrayElemType = qual1.tpe.widen match
130131 case JavaArrayType (elemtp) => elemtp
You can’t perform that action at this time.
0 commit comments