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

Tooltip in IDE suggests wrong type of parameter or even multiple types #17036

Open
BoundedChenn31 opened this issue Apr 11, 2024 · 2 comments
Open
Labels
Area-FCS Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@BoundedChenn31
Copy link
Contributor

Repro steps

type U1 = { Name: string }
type U2 = { Age: int; Name: string }

let test =
    seq<U1 -> string> {
        fun u -> u.Name
    }
    |> Seq.map (fun (f: U1 -> string) -> [| f |])
  1. Hover over u parameter. Tooltip says that it's type is U2 but it is U1 actually.

2024-04-11_203434

  1. Also, for .Name-part tooltip shows both types U1 and U2. I would expect to see only one type.

2024-04-11_203445

As far as I can see code compiles and runs correctly without runtime errors, IL doesn't mention U2 type besides declaration.

I suspect these problems are related but tell me if I should create separate issue for each one :)

Related information

  • .NET SDK 8.0.204
  • VS 17.9.6 and also Rider 2024.1, probably not specific to IDE.
@brianrourkeboll
Copy link
Contributor

The same thing also shows with Ionide in VS Code:

Recording.2024-04-12.144420.mp4

@abonie abonie added Area-FCS Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Needs-Triage labels Apr 15, 2024
@BoundedChenn31
Copy link
Contributor Author

Noticed that the same code fails to compile with 7.0.202 SDK. Compiler treats u as U2 and doesn't see seq<U1 -> string> when deducing:

Error FS0193 : Type constraint mismatch. The type 
    'U2 -> string'    
is not compatible with type
    'U1 -> string'

Really hope that it's not a regression, I don't want to write fun (u: U1) -> u.Name again in the future 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FCS Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Status: New
Development

No branches or pull requests

3 participants