Skip to content

Commit

Permalink
Handle ByName in init checker
Browse files Browse the repository at this point in the history
 - Handle combinations of NamedArg and ByName
 - Accept and evaluate any remainign ByName applications
  • Loading branch information
odersky committed Jan 19, 2022
1 parent 2066020 commit 00091c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/init/Semantic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,9 @@ object Semantic {
case Return(expr, from) =>
eval(expr, thisV, klass).ensureHot("return expression may only be initialized value", expr)

case ByName(expr) =>
eval(expr, thisV, klass)

case WhileDo(cond, body) =>
val ress = eval(cond :: body :: Nil, thisV, klass)
Result(Hot, ress.flatMap(_.errors))
Expand Down

0 comments on commit 00091c5

Please sign in to comment.