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

Compilation error "Incorrect number of type arguments to local call" #30

Closed
KevinRansom opened this issue Jan 17, 2015 · 0 comments
Closed
Labels

Comments

@KevinRansom
Copy link
Member

Opened by:vandroiy on Codeplex

F# debug compilation in Visual Studio sometimes fails with the error "Incorrect number of type arguments to local call". A lot of seemingly unrelated circumstances influence the appearance of the error.

See this question on Stackoverflow

Shortest reproduction I know of:
◾Use VS2013 (reproduced in Community, also with F# 3.1.2 installed) or VS2012 (reproduced in Pro)
◾Make a project that compiles to an executable or library (not interactive/scripting)
◾Use debug configuration (no optimizations enabled)
◾Add the following code and attempt to compile (The code editor won't predict the error)

type R<[<Measure>] 'u> (f : float<'u>) =
    member r.Member = f

let get (r : R<_>) = r.Member
let foo =
    let problem _ = List.map get
    problem // Error: Incorrect number of type arguments to local call

The error disappears from various attempts to simplify the example code (see the Stackoverflow question). Declaring problem functions as inline can serve as a workaround.

comments
latkin wrote Dec 17, 2014 at 4:18 PM [x]
I can reproduce this on Windows with 3.0, 3.1, and 4.0.

@latkin latkin added the Bug label Jan 19, 2015
andrewjkennedy pushed a commit to andrewjkennedy/visualfsharp that referenced this issue Jan 28, 2015
Code was comparing a pre-erasure list of arguments with a post-erasure list
andrewjkennedy pushed a commit to andrewjkennedy/visualfsharp that referenced this issue Jan 28, 2015
Code was comparing a pre-erasure list of arguments with a post-erasure list
andrewjkennedy pushed a commit to andrewjkennedy/visualfsharp that referenced this issue Jan 29, 2015
@latkin latkin closed this as completed in 9ca869d Jan 30, 2015
@latkin latkin added the fixed label Jan 30, 2015
KevinRansom pushed a commit that referenced this issue Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants