You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug, F# 4.0 inlining inside derived class *always* throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value #740
Combining inheritance and inlining instance members on the derived class throws an internal error and a (somewhat, but erroneous) normal error:
FS0073: Internal error: The mustinline value 'SomethingElse' was not inferred to have a known value
FS1113: The value 'SomethingElse' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
This behavior can be seen by using the following trivial example (it doesn't matter whether the base class has types or not):
type A() =
static member inline dosomething() = ()
type B() =
inherit A()
member inline this.SomethingElse a = a + 10
The first error suggests that the type inference fails. Yet, adding a specific type decoration to the member doesn't make the error go away.
The second error suggests that the implementation is using something that cannot be accessed. This seems to be just plain wrong, as the implementation of SomethingElse has no dependencies. Adding explicit public methods to the base class does not help to fool the compiler.
In short, at present, it is not possible to combine instance member inlining with base classes.
I have not managed (yet) to find a workaround, though I'd be interested if one exists. I have reported this previously at StackOverflow
Note (2): if you run this example from the command prompt, it repeats each error twice, on the exact same line and position:
error FS0073: internal error: the mustinline value 'SomethingElse' was not inferred to have a known value
error FS1113: The value 'SomethingElse' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
error FS0073: internal error: the mustinline value 'SomethingElse' was not inferred to have a known value
error FS1113: The value 'SomethingElse' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
changed the title [-]Bug, F# 4.0 with class inheritance throwing internal error: the mustinline value 'Foo' was not inferred to have a known value[/-][+]Bug, F# 4.0 with class inheritance throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/+]on Nov 26, 2015
changed the title [-]Bug, F# 4.0 with class inheritance throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/-][+]Bug, F# 4.0 inlining inside derived class *always* throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/+]on Nov 26, 2015
@KevinRansom out of curiosity, why removing the priority? From what it looks like, this is a (moderately) serious bug in the sense that a feature that is supposed to work, won't compile at all.... (but perhaps I just don't know well enough how the prioritization works around here).
It looks like all the priority labels have been removed - they were just adhoc labels I was adding based on my own estimates. I presume Kevin and others will re-add some kind of prioritization labels as part of the work for #752.
@dsyme, the date on this fix suggests it was fixed back in December 2015, which makes me think it was part of the most recent Update 3 of Visual Studio and the F# fixes that went along.
However, just trying out the example from the original bug report still shows the same errors. Does this mean it isn't fixed, or does this mean it is fixed but will be available in some later release? Could I find this (what release the fix will be published in) out somehow without bothering you about it?
Activity
[-]Bug, F# 4.0 with class inheritance throwing internal error: the mustinline value 'Foo' was not inferred to have a known value[/-][+]Bug, F# 4.0 with class inheritance throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/+][-]Bug, F# 4.0 with class inheritance throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/-][+]Bug, F# 4.0 inlining inside derived class *always* throwing FS0073 internal error: the mustinline value 'Foo' was not inferred to have a known value[/+]abelbraaksma commentedon Dec 4, 2015
@KevinRansom out of curiosity, why removing the priority? From what it looks like, this is a (moderately) serious bug in the sense that a feature that is supposed to work, won't compile at all.... (but perhaps I just don't know well enough how the prioritization works around here).
dsyme commentedon Dec 4, 2015
It looks like all the priority labels have been removed - they were just adhoc labels I was adding based on my own estimates. I presume Kevin and others will re-add some kind of prioritization labels as part of the work for #752.
dsyme commentedon Dec 4, 2015
I've pushed a fix here: #740
dsyme commentedon Jul 18, 2016
Fixed
abelbraaksma commentedon Dec 19, 2016
@dsyme, the date on this fix suggests it was fixed back in December 2015, which makes me think it was part of the most recent Update 3 of Visual Studio and the F# fixes that went along.
However, just trying out the example from the original bug report still shows the same errors. Does this mean it isn't fixed, or does this mean it is fixed but will be available in some later release? Could I find this (what release the fix will be published in) out somehow without bothering you about it?
abelbraaksma commentedon Oct 4, 2017
Tested this today again with the VS2017 Enterprise RTM release. It works, no need to reopen. Tx!
dsyme commentedon Oct 4, 2017
@abelbraaksma Thank you so much!