We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 514334e + b1d7725 commit e7bf561Copy full SHA for e7bf561
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