所以,奇怪的问题,我有一个结构和记录。两者都实现了ITick接口,但是当在C#中引用滴答时,元数据没有显示来自接口的继承。对于RedisTick记录类型,尽管接口是继承的。
我是否遗漏了代码中的某些内容/这是一个错误/它有什么问题吗?
接口
type ITick =
abstract Symbol : string
abstract Date : DateTime
abstract Price : Decimal
abstract Volume : int结构
type Tick(symbol : string, date : DateTime, price : Decimal, volume : int) =
struct
member this.Symbol = symbol
member this.Date = date
member this.Price = price
member this.Volume = volume
interface ITick with
member this.Symbol = this.Symbol
member this.Date = this.Date
member this.Price = this.Price
member this.Volume = this.Volume
end记录
[<CLIMutable>]
type RedisTick =
{ Symbol : string
Date : DateTime
Price : Decimal
Volume : int }
interface ITick with
member this.Symbol = this.Symbol
member this.Date = this.Date
member this.Price = this.Price
member this.Volume = this.VolumeC#元数据:
记录在C#中
[Microsoft.FSharp.Core.CLIMutableAttribute] [Microsoft.FSharp.Core.CompilationMappingAttribute]
public sealed class RedisTick : IEquatable<RedisTick>, IStructuralEquatable, IComparable<RedisTick>, IComparable, IStructuralComparable, ITick {
public RedisTick();
public RedisTick(string symbol, DateTime date, decimal price, int volume);
[Microsoft.FSharp.Core.CompilationMappingAttribute]
public DateTime Date { get; set; }
[Microsoft.FSharp.Core.CompilationMappingAttribute]
public decimal Price { get; set; }
[Microsoft.FSharp.Core.CompilationMappingAttribute]
public string Symbol { get; set; }
[Microsoft.FSharp.Core.CompilationMappingAttribute]
public int Volume { get; set; }
[CompilerGenerated]
public sealed override int CompareTo(object obj);
[CompilerGenerated]
public sealed override int CompareTo(RedisTick obj);
[CompilerGenerated]
public sealed override int CompareTo(object obj, IComparer comp);
[CompilerGenerated]
public sealed override bool Equals(object obj);
[CompilerGenerated]
public sealed override bool Equals(RedisTick obj);
[CompilerGenerated]
public sealed override bool Equals(object obj, IEqualityComparer comp);
[CompilerGenerated]
public sealed override int GetHashCode();
[CompilerGenerated]
public sealed override int GetHashCode(IEqualityComparer comp); }结构在C#
[Microsoft.FSharp.Core.CompilationMappingAttribute]
public struct Tick : IEquatable<Tick>, IStructuralEquatable, IComparable<Tick>, IComparable, IStructuralComparable
{
public Tick(string symbol, DateTime date, decimal price, int volume);
public DateTime Date { get; }
public decimal Price { get; }
public string Symbol { get; }
public int Volume { get; }
[CompilerGenerated]
public sealed override int CompareTo(object obj);
[CompilerGenerated]
public sealed override int CompareTo(Tick obj);
[CompilerGenerated]
public sealed override int CompareTo(object obj, IComparer comp);
[CompilerGenerated]
public sealed override bool Equals(object obj);
[CompilerGenerated]
public sealed override bool Equals(Tick obj);
[CompilerGenerated]
public sealed override bool Equals(object obj, IEqualityComparer comp);
[CompilerGenerated]
public sealed override int GetHashCode();
[CompilerGenerated]
public sealed override int GetHashCode(IEqualityComparer comp);
}发布于 2015-05-03 17:15:43
解决了在VS2015 RC上的问题,它已经修好了!
https://stackoverflow.com/questions/29882546
复制相似问题