We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89a744f commit 37e4fe7Copy full SHA for 37e4fe7
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2511,6 +2511,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2511
checkSimpleKinded(parent)
2512
// allow missing type parameters if there are implicit arguments to pass
2513
// since we can infer type arguments from them
2514
+ val constr = psym.primaryConstructor
2515
+ if constr.exists then
2516
+ ensureAccessible(constr.termRef, superAccess = true, tree.srcPos)
2517
else
2518
checkParentCall(result, cls)
2519
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