We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e6a267 commit b9f1c9eCopy full SHA for b9f1c9e
src/main/scala/decaf/typecheck/Typer.scala
@@ -164,7 +164,7 @@ class Typer extends Phase[Tree, Tree]("typer") with Util {
164
}
165
val actual = e.map(_.typ).getOrElse(VoidType)
166
if (actual.noError && !(actual <= expected)) issue(new BadReturnTypeError(expected, actual, stmt.pos))
167
- Return(e)(Yes) // returned
+ Return(e)(if (e.isDefined) Yes else No) // returned if it has an expression
168
169
case Print(exprs) =>
170
val es = exprs.zipWithIndex.map {
0 commit comments