Error on Extension Methods when Inlining

后端 未结 2 674
北荒
北荒 2021-01-13 14:57

I want to extend some system types and later use them via inlining

type System.String with  
    member this.foo n = this + \"!\" + n 

type System.Boolean w         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-13 15:17

    Statically resolved type constraints do not support extension methods. It's just not a feature of F#.

    If you would like F# to gain support for higher-kinded polymorphism, you can vote for it on user voice.

提交回复
热议问题