What do “the mustinline value … was not inferred to have a known value” and “marked inline but not bound in the optimization environment” mean?

六月ゝ 毕业季﹏ 提交于 2019-12-23 11:36:17

问题


I have run into a compile-time error I do not understand while working with F# in Visual Studio 2012.

I could find a minimal snippet here: http://ideone.com/hbhbF

type Foo() =
     inherit System.Exception()
     member inline this.Bar() = ()

Foo().Bar()

What do the following error messages mean?

/home/iU0RLi/prog.fs(3,22): error FS0073: internal error: the mustinline value 'Bar' was not inferred to have a known value

/home/iU0RLi/prog.fs(5,1): error FS1114: The value 'Prog.Foo.Bar' was marked inline but was not bound in the optimization environment

/home/iU0RLi/prog.fs(3,22): error FS1113: The value 'Bar' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible

/home/iU0RLi/prog.fs(5,1): warning FS1116: A value marked as 'inline' has an unexpected value

/home/iU0RLi/prog.fs(5,1): error FS1118: Failed to inline the value 'Bar' marked 'inline', perhaps because a recursive value was marked 'inline'

来源:https://stackoverflow.com/questions/12445049/what-do-the-mustinline-value-was-not-inferred-to-have-a-known-value-and-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!