We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents da9628f + 391730a commit ed57e32Copy full SHA for ed57e32
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2512,6 +2512,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2512
checkSimpleKinded(parent)
2513
// allow missing type parameters if there are implicit arguments to pass
2514
// since we can infer type arguments from them
2515
+ val constr = psym.primaryConstructor
2516
+ if psym.is(Trait) && constr.exists && !cls.isRefinementClass then
2517
+ ensureAccessible(constr.termRef, superAccess = true, tree.srcPos)
2518
else
2519
checkParentCall(result, cls)
2520
if cls is Case then
tests/neg/i17089.scala
@@ -0,0 +1,4 @@
1
+object o:
2
+ trait T private[o]()
3
+
4
+def test = new o.T { } // error
0 commit comments