提交 9ca869db 编写于 作者: A andrewjkennedy 提交者: latkin

Fix for #30 -- Incorrect number of type arguments to local call

fixes #30
closes #167

commit ef01ef3962261a4f091c1d8f7c74423274bade28
Author: andrewjkennedy <akenn@microsoft.com>
Date:   Thu Jan 29 15:21:05 2015 +0000

    Whitespace change to kick AppVeyor

commit 6cc2e7734f867fe976cd63bc33d7cfe35161710b
Author: andrewjkennedy <akenn@microsoft.com>
Date:   Thu Jan 29 10:02:20 2015 +0000

    Regression test for issue #30

commit 72635a9929fb09dd58b9b3e071247a22458d78b8
Author: andrewjkennedy <akenn@microsoft.com>
Date:   Wed Jan 28 12:42:32 2015 +0000

    Fix for https://github.com/Microsoft/visualfsharp/issues/30
    Code was comparing a pre-erasure list of arguments with a post-erasure list
上级 7b1d8964
......@@ -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.
......
......@@ -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>]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册