How to downcast in F# while ignoring the generic types?

前端 未结 0 1783
误落风尘
误落风尘 2021-01-20 12:39

Consider the following code with downcasting:

let list = [1; 2; 4] :> obj

// Successful
let list2 = list :?> int list

// Exception - System.InvalidCas         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题