Skip to content

Commit b9fa8cb

Browse files
Merge pull request #9745 from dotty-staging/fix-#2727
Fix #2727: Add self type explain to UnboundPlaceholderParameter
2 parents 904f407 + 7d183a0 commit b9fa8cb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

compiler/src/dotty/tools/dotc/reporting/messages.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,17 @@ import ast.tpd
527527
|but an uninitialized var definition.
528528
|Only fields can be left uninitialized in this manner; local variables
529529
|must be initialized.
530+
|
531+
|Another occurrence for this error is self type definition.
532+
|The ${hl("_")} can be replaced with ${hl("this")}.
533+
|
534+
|Example before:
535+
|
536+
|${hl("trait A { _: B => ... ")}
537+
|
538+
|Example after:
539+
|
540+
|${hl("trait A { this: B => ... ")}
530541
|"""
531542
}
532543

@@ -2411,4 +2422,4 @@ import ast.tpd
24112422
|The variable does not occur in the signature of ${hl(owner)}.
24122423
|""".stripMargin
24132424
def explain = ""
2414-
}
2425+
}

0 commit comments

Comments
 (0)