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

False type mismatch error using union types #73

Closed
timothee-haudebourg opened this issue Nov 10, 2022 · 0 comments
Closed

False type mismatch error using union types #73

timothee-haudebourg opened this issue Nov 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@timothee-haudebourg
Copy link
Collaborator

Consider the following TreeLDR file:

use <http://www.example.com/> as ex;

type A {
	ex:prop: A | &A
	//       ^^^^^^ this is _:0
}

type B {
	ex:prop: A | &A
	//       ^^^^^^ this is _:1
}

The compiler raises an error because the two occurences of the same union type are given different blank node identifiers, so there is a type mismatch here. There are two issues at play here:

  • Semanticaly equivalent blank nodes are merged too late. They should be merged before the type checking phase.
  • A | &A is considered to be a union type even though it is in fact the type A with a different layout. If the union was properly erased, the previous issue should not interfere.
@timothee-haudebourg timothee-haudebourg added the bug Something isn't working label Nov 10, 2022
@timothee-haudebourg timothee-haudebourg self-assigned this Nov 10, 2022
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

1 participant