Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflow #1000

Open
HoshinoTented opened this issue Oct 1, 2023 · 1 comment
Open

StackOverflow #1000

HoshinoTented opened this issue Oct 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@HoshinoTented
Copy link
Contributor

Aya version: Aya 0.30-SNAPSHOT (9134503de233dad58f12e83920d9445829542578)

Code:

> open data Nat | O | S Nat
data Nat : Type 0
  | O
  | S (_5 : Nat)
> :{
| overlap def badPlus Nat Nat : Nat
| | a, O => a
| | O, b => b
| | a, S b => badPlus (S a) b
| | S a, b => badPlus a (S b)
| :}

Stacktrace (too long):

java.lang.StackOverflowError
java.lang.StackOverflowError
        at kala.collection.internal.hash.HashUtils.computeHash(HashUtils.java:26)
        at kala.collection.mutable.MutableHashMap.put(MutableHashMap.java:526)
        at org.aya.core.visitor.Subst.addDirectly(Subst.java:67)
        at org.aya.core.pat.PatMatcher.match(PatMatcher.java:57)
        at org.aya.core.pat.PatMatcher.match(PatMatcher.java:52)
        at kala.function.CheckedBiConsumer.accept(CheckedBiConsumer.java:23)
        at kala.collection.base.Iterators.forEachWith(Iterators.java:1289)
        at kala.collection.base.Traversable.forEachWith(Traversable.java:1043)
        at kala.collection.base.Traversable.forEachWithChecked(Traversable.java:1048)
        at org.aya.core.pat.PatMatcher.visitList(PatMatcher.java:129)
        at org.aya.core.pat.PatMatcher.match(PatMatcher.java:64)
        at org.aya.core.pat.PatMatcher.match(PatMatcher.java:52)
        at kala.function.CheckedBiConsumer.accept(CheckedBiConsumer.java:23)
        at kala.collection.base.Iterators.forEachWith(Iterators.java:1289)
        at kala.collection.base.Traversable.forEachWith(Traversable.java:1043)
        at kala.collection.base.Traversable.forEachWithChecked(Traversable.java:1048)
        at org.aya.core.pat.PatMatcher.tryBuildSubst(PatMatcher.java:43)
        at org.aya.core.visitor.DeltaExpander.tryUnfoldClauses(DeltaExpander.java:75)
        at org.aya.core.visitor.DeltaExpander.lambda$post$3(DeltaExpander.java:47)
        at kala.control.Either$Right.fold(Either.java:332)
        at org.aya.core.visitor.DeltaExpander.post(DeltaExpander.java:45)
        at org.aya.core.visitor.Expander.post(Expander.java:17)
        at org.aya.core.visitor.EndoTerm.apply(EndoTerm.java:46)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:27)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:22)
        at kala.control.Option.map(Option.java:163)
        at org.aya.core.visitor.DeltaExpander.lambda$post$3(DeltaExpander.java:48)
        at kala.control.Either$Right.fold(Either.java:332)
        at org.aya.core.visitor.DeltaExpander.post(DeltaExpander.java:45)
        at org.aya.core.visitor.Expander.post(Expander.java:17)
        at org.aya.core.visitor.EndoTerm.apply(EndoTerm.java:46)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:27)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:22)
        at kala.control.Option.map(Option.java:163)
        at org.aya.core.visitor.DeltaExpander.lambda$post$3(DeltaExpander.java:48)
        at kala.control.Either$Right.fold(Either.java:332)
        at org.aya.core.visitor.DeltaExpander.post(DeltaExpander.java:45)
        at org.aya.core.visitor.Expander.post(Expander.java:17)
        at org.aya.core.visitor.EndoTerm.apply(EndoTerm.java:46)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:27)
        at org.aya.core.visitor.Expander$WHNFer.apply(Expander.java:22)
        ...... (too long)
@HoshinoTented HoshinoTented added the bug Something isn't working label Oct 1, 2023
@ice1000
Copy link
Member

ice1000 commented Oct 2, 2023

Match should probably be done after termination check IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants