.net – F#int.MaxValue是“不是有效的常量表达式”,但System.Int32.MaxValue是?

TL; DR:F#编译器在本上下文中将int解释为 int operator,如 determined by Eugene Fotin和 expanded upon by Gene Belitski.最佳解决方法是使用System.Int32.MaxValue或唯一类型别名,如下所述. 考虑以下记录类型: type User = { Username : string} 我想要用

返回顶部