Closed johnynek closed 5 years ago
Saw this again. I need to run this down. I'm more concerned there is a real issue lurking here. Clearly it is very rare, but, possible;
[info] - a - b = c then c - b == c, because we have already removed all of b *** FAILED *** (2 seconds, 751 milliseconds)
[info] TestFailedException was thrown during property evaluation.
[info] Message: eqList.eqv(c1, c) was false _ - (b=[sexzvprlrk | Tuple2(['mtdiwtyuz'], Tuple2(bf, Tuple2(_ | 'pldwGc' | d37ex5 | 'ze', Tuple2(tggjLBa7pqx@'kJx', Unit)))) | GK4Xfgcipl(_, glAgD9esr, ws@_), jrtbcbtf] | [*jeirnnqtGm, Tuple2(['pcy', 38027992902547094095662547774507581670], Tuple2(p@(bff1tt | 'jpowqrg' | 3487874632454807417865993456819222103), Tuple2([*adwaiivbyjc, s3ean, _] | Tuple2('otxy', Tuple2(_, Unit)) | 21141336622304968484529379404094378038, Unit)))] | Zwez('i9h')) = List([], [_], [_, jrtbcbtf, _, *_]) - b = List([], [Tuple2([*_], _)], [Tuple2(['pcy', 38027992902547094095662547774507581670], Tuple2(_, Tuple2([], _)))], [Tuple2(['pcy', 38027992902547094095662547774507581670], Tuple2(_, Tuple2([_], _)))], [_, jrtbcbtf, _, *_]) diff = List([_])
[info] Location: (TotalityTest.scala:501)
[info] Occurred when passed generated values (
[info] arg0 = WildCard,
[info] arg1 = Union(ListPat(List(Right(Union(Var(sexzvprlrk),NonEmptyList(PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(ListPat(List(Right(Literal(Str(mtdiwtyuz))))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Var(bf), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Union(WildCard,NonEmptyList(Literal(Str(pldwGc)), Var(d37ex5), Literal(Str(ze)))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Named(tggjLBa7pqx,Literal(Str(kJx))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Unit)),List()))))))))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(GK4Xfgcipl)),List(WildCard, Var(glAgD9esr), Named(ws,WildCard)))))), Right(Var(jrtbcbtf)))),NonEmptyList(ListPat(List(Left(Some(jeirnnqtGm)), Right(PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(ListPat(List(Right(Literal(Str(pcy))), Right(Literal(Integer(38027992902547094095662547774507581670))))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Named(p,Union(Var(bff1tt),NonEmptyList(Literal(Str(jpowqrg)), Literal(Integer(3487874632454807417865993456819222103))))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Union(ListPat(List(Left(Some(adwaiivbyjc)), Right(Var(s3ean)), Right(WildCard))),NonEmptyList(PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(Literal(Str(otxy)), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Tuple2)),List(WildCard, PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Unit)),List()))))), Literal(Integer(21141336622304968484529379404094378038)))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Unit)),List())))))))))), PositionalStruct((PackageName(NonEmptyList(Bosatsu, Predef)),ConstructorName(Zwez)),List(Literal(Str(i9h))))))
[info] )
see: https://travis-ci.org/johnynek/bosatsu/jobs/497642577#L1280
This may be another version of list unions not having a normal form (which I guess will be true of any recursive type we support). Although, I don't think it means the totality check is wrong, I think the laws are just hard to always check since we don't have good equality on patterns.
Actually... thinking more: aren't two patterns equal if you can
a - b
is empty andb - a
is empty? Maybe that can solve this.