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
typeIncrementor(z)=abstractmemberIncrement :intbyref*intbyref->unitdefaultthis.Increment(i :int byref,j :int byref)=
i <- i + z
typeDecrementor(z)=inherit Incrementor(z)overridethis.Increment(i,j)=base.Increment(&i,&j)
i <- i - z
the error is:
error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL.
But this slight variation compiles fine:
typeIncrementor(z)=abstractmemberIncrement :intbyref*intbyref->unitdefaultthis.Increment(i :int byref,j :int byref)=
i <- i + z
typeDecrementor(z)=inherit Incrementor(z)overridethis.Increment(i,j)=
this.Increment(&i,&j)
i <- i - z
All I’ve done is to change the target of Increment in the override from base to this (so it will stack overflow at runtime), which shows that the compiler is somehow analyzing the base call and a normal call differently (and, I believe wrongly in the former case).
The text was updated successfully, but these errors were encountered:
From Codeplex opened by kvb
Based on the problem reported here: http://stackoverflow.com/questions/24324547/f-method-with-byref-parameter-override.
This fails to compile
the error is:
But this slight variation compiles fine:
All I’ve done is to change the target of Increment in the override from base to this (so it will stack overflow at runtime), which shows that the compiler is somehow analyzing the base call and a normal call differently (and, I believe wrongly in the former case).
The text was updated successfully, but these errors were encountered: