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

Possible bugs on resolving type alias to record type #349

Closed
cannorin opened this issue Jan 21, 2022 · 4 comments
Closed

Possible bugs on resolving type alias to record type #349

cannorin opened this issue Jan 21, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@cannorin
Copy link

cannorin commented Jan 21, 2022

Version: 1.2.0
Related: #311

I think I've found several bugs around type alias to record type.

Assume we have the following code:

type foo<'a> = { content: 'a }
type bar = { age: int }
type foobar = foo<bar>

let x1: foo<bar> = { content: { age: 42 } }
let x2: foobar = { content: { age: 42 } }
  1. When I hover on content in let x1: foo<bar> = { content: { age: 42 } }, it shows 'a instead of bar.

    • This is kind of "correct" behavior, as it is just failing to substitute the type variable 'a.
    • As a result of this, I don't get autocompletion when I enter x1.content..
  2. When I hover on content in let x2: foobar = { content: { age: 42 } }, it shows foo<'a> instead of bar.

    • This is not correct, as content does not have type foo<'a>.
    • I also don't get autocompletion when I enter x2.content..
      • This is a bit strange since if it really thinks x2.content has type foo<'a> it should provide content as autocompletion.
    • What is interesting here is when I hover on age in x2.content.age it shows int, which is correct.
@cannorin
Copy link
Author

cannorin commented Jan 22, 2022

I think the first part of this issue is a duplicate of #310.

@cristianoc
Copy link
Collaborator

Confirming this is still the case, with a test be92c6c

@cristianoc
Copy link
Collaborator

The hovering part is done here: #560

The completion part is still open.

@cristianoc
Copy link
Collaborator

Completion part also done.

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

3 participants