f# - Fsi fails to augment a type constructor - bug or feature? -


let's take type augmentation abusive f# script below:

type augmentme = val _i : int type augmentme member i.i = i._i type augmentme new(i) = { _i = } printfn "augmentme instance: %i" (augmentme(42).i)      

that, when being interpreted whole, yields expected fsi output:

>  augmentme instance: 42  type augmentme =   class     new : i:int -> augmentme     val _i: int     member : int   end val : unit = () 

now, if reset fsi session , interpret same script, time line-by-line, fsi fails add type constructor following diagnostics last 2 script lines:

>  type augmentme =   class     val _i: int   end >  type augmentme   member : int >   ~vs7894.fsx(3,30): warning fs0073: internal error: pop on empty stack during code generation, methodname = augmentme..ctor, m = c:\users\gene\appdata\local\temp\~vs7894.fsx(3,29)-(3,39)  type augmentme   new : i:int -> augmentme >   ~vs7894.fsx(4,35): error fs0039: value or constructor 'augmentme' not defined 

after googling following mentioning circa 2011 has popped up, apparently artifact still has place.

what gives? should report fsbugs? thank you.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -