File tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/reporting/diagnostic 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1342,11 +1342,11 @@ object messages {
1342
1342
val msg = s " ${if (mutable) " `var'" else " `val'" } parameters may not be call-by-name "
1343
1343
val kind = " Syntax"
1344
1344
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 " }
1350
1350
| ${" }" }
1351
1351
| """
1352
1352
}
You can’t perform that action at this time.
0 commit comments