Skip to content

Commit

Permalink
Fix for #30 -- Incorrect number of type arguments to local call
Browse files Browse the repository at this point in the history
fixes #30
closes #167

commit ef01ef3
Author: andrewjkennedy <[email protected]>
Date:   Thu Jan 29 15:21:05 2015 +0000

    Whitespace change to kick AppVeyor

commit 6cc2e77
Author: andrewjkennedy <[email protected]>
Date:   Thu Jan 29 10:02:20 2015 +0000

    Regression test for issue #30

commit 72635a9
Author: andrewjkennedy <[email protected]>
Date:   Wed Jan 28 12:42:32 2015 +0000

    Fix for #30
    Code was comparing a pre-erasure list of arguments with a post-erasure list
  • Loading branch information
andrewjkennedy authored and latkin committed Jan 30, 2015
1 parent 7b1d896 commit 9ca869d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fsharp/ilxgen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ and GenNamedLocalTyFuncCall cenv (cgbuf: CodeGenBuffer) eenv typ cloinfo tyargs

let ilContractTy = mkILBoxedTy ilContractCloTySpec.TypeRef ilContractClassTyargs

if not (ilContractMethTyargs.Length = tyargs.Length) then errorR(Error(FSComp.SR.ilIncorrectNumberOfTypeArguments(),m));
if not (ilContractMethTyargs.Length = ilTyArgs.Length) then errorR(Error(FSComp.SR.ilIncorrectNumberOfTypeArguments(),m));

// Local TyFunc are represented as a $contract type. they currently get stored in a value of type object
// Recover result (value or reference types) via unbox_any.
Expand Down
13 changes: 13 additions & 0 deletions tests/fsharp/core/unitsOfMeasure/test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ let CreateBadImageFormatException () =
let create a b c d (e:int<_>) (f:int) g = TheType.Create a b (int c) d e f g
seq { yield create 0 0 0 0 0 0 [0] }


// Regression test for https://github.com/Microsoft/visualfsharp/issues/30
// (Compilation error: "Incorrect number of type arguments to local call"

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


module TestLibrary =

[<Measure>]
Expand Down

0 comments on commit 9ca869d

Please sign in to comment.