Skip to content

Commit 00091c5

Browse files
committed
Handle ByName in init checker
- Handle combinations of NamedArg and ByName - Accept and evaluate any remainign ByName applications
1 parent 2066020 commit 00091c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,9 @@ object Semantic {
11921192
case Return(expr, from) =>
11931193
eval(expr, thisV, klass).ensureHot("return expression may only be initialized value", expr)
11941194

1195+
case ByName(expr) =>
1196+
eval(expr, thisV, klass)
1197+
11951198
case WhileDo(cond, body) =>
11961199
val ress = eval(cond :: body :: Nil, thisV, klass)
11971200
Result(Hot, ress.flatMap(_.errors))

0 commit comments

Comments
 (0)