我特別想寫的擴展方法對於這種類型的:如何寫一個泛型類型的擴展方法,其中一個類型變量必須是字符串?
type Frame<'TRowKey, string when 'TRowKey : equality> with
member frame.someMethod =
// code
與該代碼,我得到這個錯誤:
Unexpected identifier in type name. Expected infix operator, quote symbol or other token.
更換string
與String
給出了相同的結果。
來自Deedle庫的原始類型爲Frame<'TRowKey, 'TColumnKey (requires equality and equality)>
。
請注意,類型約束必須寫在左側,請參閱我的更新答案。 – Gustavo