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.
2 parents 8d04b6b + 0fe3072 commit ca4b235Copy full SHA for ca4b235
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -979,7 +979,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
979
}
980
def enclMethInfo(cx: Context): (Tree, Type) = {
981
val owner = cx.owner
982
- if (cx == NoContext || owner.isType) {
+ if (owner.isType) {
983
ctx.error("return outside method definition", tree.pos)
984
(EmptyTree, WildcardType)
985
0 commit comments