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

Lang: re-provided type from one module incompatible with origin module #1886

Closed
alex-snezhko opened this issue Jul 16, 2023 · 1 comment · Fixed by #2051
Closed

Lang: re-provided type from one module incompatible with origin module #1886

alex-snezhko opened this issue Jul 16, 2023 · 1 comment · Fixed by #2051
Assignees
Labels

Comments

@alex-snezhko
Copy link
Member

// c.gr
module C
provide record T {
  x: Number
}

// b.gr
module B
include "./c"
from C use { type T }
let a = { x: 1 }
provide { type T, a }

// a.gr
module A
include "./b"
from B use { type T, a }
print(a == { x: 1 })

The above code fails to compile with the error

Error: This expression has type B.T but an expression was expected of type
         C.T
C::T is abstract because no corresponding cmi file was found in path.
@peblair
Copy link
Member

peblair commented Feb 18, 2024

I have not come up with a fix yet, but a preliminary look says that the root cause here is the type_manifest field not getting set on B.T at import time (see Env.use_partial_signature). This field is used in the unification engine to handle type T = T0-type declarations in OCaml, so hopefully getting it wired up fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants