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

Module ascription does not type check #2120

Open
athas opened this issue Mar 12, 2024 · 0 comments
Open

Module ascription does not type check #2120

athas opened this issue Mar 12, 2024 · 0 comments

Comments

@athas
Copy link
Member

athas commented Mar 12, 2024

module type dict = {
  type~ dict
  val empty : dict
}

module naive_dict : dict = {
  type~ dict = []bool
  def empty = []
}

The problem is related to how we handle size-lifted types in module ascriptions. We end up requiring that empty can produce an array of any size, because after substitution its type scheme becomes val empty [d₀] : [d₀]bool. Probably we should lift these anonymous sizes to the top level instead of attaching them as size parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant