Skip to content
Snippets Groups Projects
Commit 12896ea5 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Replacing empty finite sets should keep type information

parent 4155b291
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,17 @@ object Extractors { ...@@ -88,7 +88,17 @@ object Extractors {
case CaseClass(cd, args) => Some((args, CaseClass(cd, _))) case CaseClass(cd, args) => Some((args, CaseClass(cd, _)))
case And(args) => Some((args, And.apply)) case And(args) => Some((args, And.apply))
case Or(args) => Some((args, Or.apply)) case Or(args) => Some((args, Or.apply))
case FiniteSet(args) => Some((args, FiniteSet)) case FiniteSet(args) =>
Some((args,
{ newargs =>
if (newargs.isEmpty) {
FiniteSet(Seq()).setType(expr.getType)
} else {
FiniteSet(newargs)
}
}
))
case FiniteMap(args) => { case FiniteMap(args) => {
val subArgs = args.flatMap{case (k, v) => Seq(k, v)} val subArgs = args.flatMap{case (k, v) => Seq(k, v)}
val builder: (Seq[Expr]) => Expr = (as: Seq[Expr]) => { val builder: (Seq[Expr]) => Expr = (as: Seq[Expr]) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment