什么“的mustinline价值......不是推断有一个已知值”和“内联标记,但在优化环境不绑定”

2019-09-22 11:25发布

我遇到了一个编译时错误,在Visual Studio 2012与F#的工作,而我不明白。

我可以在这里找到一个最小的片段: http://ideone.com/hbhbF

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

Foo().Bar()

什么是以下错误消息是什么意思?

/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'
文章来源: What do “the mustinline value … was not inferred to have a known value” and “marked inline but not bound in the optimization environment” mean?