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

Curried static members do not support subsumption on later arguments #10061

Closed
kevmal opened this issue Sep 3, 2020 · 2 comments
Closed

Curried static members do not support subsumption on later arguments #10061

kevmal opened this issue Sep 3, 2020 · 2 comments

Comments

@kevmal
Copy link
Contributor

kevmal commented Sep 3, 2020

This is all fine:

type T() =
    static member F() = fun (x : int seq) -> ()

let g = T.F()
g [1;2;3]

let f() = 
    printfn ".."
    fun (x : int seq) -> ()

f() [2;3;4]

type U() =
    static member F () (x : int seq) = ()
U.F() [1;2;3]

Where this

T.F() [1;2;3]

produces the error

error FS0001: This expression was expected to have type
    'seq<int>'    
but here has type
    ''a list'    
@dsyme
Copy link
Contributor

dsyme commented Sep 3, 2020

Can you open this as a language design suggestion? thanks

@dsyme dsyme changed the title No implicit upcast on function arg after method call Curried static members do not support subsumption on later arguments Sep 4, 2020
@dsyme
Copy link
Contributor

dsyme commented Sep 4, 2020

Recorded at fsharp/fslang-suggestions#916 and as a language spec clarification here fsharp/fsharp.org#841

@dsyme dsyme closed this as completed Sep 4, 2020
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

No branches or pull requests

2 participants