Skip to content

Commit 64f2333

Browse files
committed
Use hasHigherKind in accessibleSelectionType test
1 parent 7ce3ea0 commit 64f2333

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ trait TypeAssigner {
255255
*/
256256
def accessibleSelectionType(tree: untpd.RefTree, qual1: Tree)(implicit ctx: Context): Type = {
257257
var qualType = qual1.tpe.widenIfUnstable
258-
if (qualType.isLambdaSub) qualType = errorType(em"$qualType takes type parameters", qual1.pos)
258+
if (qualType.hasHigherKind && tree.name != nme.CONSTRUCTOR)
259+
// constructors are selected on typeconstructor, type arguments are passed afterwards
260+
qualType = errorType(em"$qualType takes type parameters", qual1.pos)
259261
else if (!qualType.isInstanceOf[TermType]) qualType = errorType(em"$qualType is illegal as a selection prefix", qual1.pos)
260262
val ownType = selectionType(qualType, tree.name, tree.pos)
261263
ensureAccessible(ownType, qual1.isInstanceOf[Super], tree.pos)

0 commit comments

Comments
 (0)