小编gar*_*kes的帖子

使用带有F#类型的CLR接口

我使用任何体面的C#接口与我的F#类型有一些问题,所以我在一个项目中有以下C#接口...

//C#
namespace FunctionalInterfacing  
{  
    public interface IFoo  
    {  
        string Bar(string a, string b);  
    }  
}  
Run Code Online (Sandbox Code Playgroud)

现在我想在F#中编写一个实现它的类型..

#light
module FunctionalInterfacing.Concrete
open FunctionalInterfacing

type public ConcreteType = 
    interface IFoo with
        member this.Bar a b = a
Run Code Online (Sandbox Code Playgroud)

这似乎不起作用,我得到以下错误...

此覆盖对相应的抽象成员采用不同数量的参数

有任何想法吗?

c# clr f# interface

2
推荐指数
1
解决办法
256
查看次数

标签 统计

c# ×1

clr ×1

f# ×1

interface ×1