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 754fa51 commit b1d7725Copy full SHA for b1d7725
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -862,10 +862,8 @@ class Typer extends Namer
862
case tree: untpd.FunctionWithMods => tree.mods.flags
863
case _ => EmptyFlags
864
}
865
- if (funFlags.is(Erased) && args.isEmpty) {
866
- ctx.error("An empty function cannot not be erased", tree.sourcePos)
867
- funFlags = funFlags &~ Erased
868
- }
+
+ assert(!funFlags.is(Erased) || !args.isEmpty, "An empty function cannot not be erased")
869
870
val funCls = defn.FunctionClass(args.length,
871
isContextual = funFlags.is(Given), isErased = funFlags.is(Erased))
0 commit comments