Skip to content

Possible bugs on resolving type alias to record type #349

@cannorin

Description

@cannorin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions