Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Nov 23, 2023

Fixes #16318 .

The following code was working fine if type argument was infered, and not working when it was explicit:
This did change the behavior for typeof, because typeof is not a keyword, but a library defined function.
A type can in theory define its own generic method with the name typeof just fine => typechecking that correctness is therefore left for subsequent typechecking phases.

module Regression
type A() =
    member x.M<'T>() = 1

let _ = [A()] |> Seq.map _.M<int>()    // <--- error was here
let _ = [A()] |> Seq.map _.M()

@T-Gro T-Gro self-assigned this Nov 23, 2023
@T-Gro T-Gro marked this pull request as ready for review November 23, 2023 14:26
@T-Gro T-Gro requested a review from a team as a code owner November 23, 2023 14:26
@T-Gro T-Gro enabled auto-merge (squash) November 27, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error from explicit generic method call in shorthand lambda

4 participants