Skip to content

Commit 391730a

Browse files
committed
Don't check parents of refinement classes for accessibility
Only check trait constructor accessibility if the trait is a parent of some other class or trait. Refinements don't fall into this category.
1 parent 37e4fe7 commit 391730a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
25122512
// allow missing type parameters if there are implicit arguments to pass
25132513
// since we can infer type arguments from them
25142514
val constr = psym.primaryConstructor
2515-
if constr.exists then
2515+
if psym.is(Trait) && constr.exists && !cls.isRefinementClass then
25162516
ensureAccessible(constr.termRef, superAccess = true, tree.srcPos)
25172517
else
25182518
checkParentCall(result, cls)

0 commit comments

Comments
 (0)