Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2511,6 +2511,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
checkSimpleKinded(parent)
// allow missing type parameters if there are implicit arguments to pass
// since we can infer type arguments from them
val constr = psym.primaryConstructor
if psym.is(Trait) && constr.exists && !cls.isRefinementClass then
ensureAccessible(constr.termRef, superAccess = true, tree.srcPos)
else
checkParentCall(result, cls)
if cls is Case then
Expand Down
4 changes: 4 additions & 0 deletions tests/neg/i17089.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object o:
trait T private[o]()

def test = new o.T { } // error