摘要: 我在Visual Studio论坛上读过一个很有趣的论坛帖子,内容大致是这样的:当试图测试一个obj对象是否是一个空的list,我们不能用模式匹配的类型测试来达到目的,具体代码如下:1 let empt (o: obj) =2 match o with3 | :? List<'a> as l when l.IsEmpty -> true4 | _ -> false编译器会报一个警告:warning FS0064: This construct causes code to be less generic than indicated by the type an 阅读全文
posted @ 2012-05-17 10:22 tryfsharp 阅读(1567) 评论(2) 推荐(0) 编辑