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

Type error in presence of type aliases in Map keys #1390

Closed
mario-bucev opened this issue Mar 20, 2023 · 0 comments · Fixed by #1391
Closed

Type error in presence of type aliases in Map keys #1390

mario-bucev opened this issue Mar 20, 2023 · 0 comments · Fixed by #1391

Comments

@mario-bucev
Copy link
Collaborator

Originally discovered by @agilot.
The following snippet:

import stainless.lang._
import stainless.collection._

object Types {
  type I = Int
}

import Types._

case class Foo(bar: Map[I, String])

causes a "type error"

[ Error  ] Type error: this.bar, expected Map[Int, Option[String]],
[ Error  ] found Map[I, Option[String]]
[ Error  ] 
[ Error  ] Typing explanation:
[ Error  ] this.bar is of type Map[I, Option[String]]
[ Error  ]   this is of type Foo
[ Fatal  ] Well-formedness check failed after extraction
[ Error  ] Stainless terminated with an error.
[ Error  ] Debug output is available in the file `stainless-stack-trace.txt`. If the crash is caused by Stainless, you may report your issue on https://github.com/epfl-lara/stainless/issues
[ Error  ] You may use --debug=stack to have the stack trace displayed in the output.
mario-bucev added a commit to mario-bucev/stainless that referenced this issue Mar 20, 2023
@mario-bucev mario-bucev linked a pull request Mar 20, 2023 that will close this issue
mario-bucev added a commit that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant