File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/reporting/diagnostic Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1342,11 +1342,11 @@ object messages {
13421342 val msg = s " ${if (mutable) " `var'" else " `val'" } parameters may not be call-by-name "
13431343 val kind = " Syntax"
13441344 val explanation =
1345- hl """ Parameters of classes and traits may no be call-by-name. In case you
1346- |want the parameter to be evaluated on demand, consider using a function
1347- |and a lazy value in the class such as
1348- | ${s " class MyClass( ${name}Tick: () => String) { " }
1349- | ${s " lazy val $name = ${name}Tick " }
1345+ hl """ ${ " var " } and ${ " val " } parameters of classes and traits may no be call-by-name. In case you
1346+ |want the parameter to be evaluated on demand, consider making it just a parameter
1347+ |and a ${ " def " } in the class such as
1348+ | ${s " class MyClass( ${name}Tick: => String) { " }
1349+ | ${s " def $name() = ${name}Tick " }
13501350 | ${" }" }
13511351 | """
13521352 }
You can’t perform that action at this time.
0 commit comments