Closed alfonsogarciacaro closed 6 years ago
@alfonsogarciacaro Yes, I just reverted the default target change in FCS-Fable. Sorry about that.
No worries, can it be easily changed for scripts? If it can't I guess it's not a big problem, we just need to make users aware of this :)
@ncave I just noticed that also now when having a value at the end of the script without consuming it (printing, etc), there's a very misleading error message. Maybe it's related to the problem above?
@alfonsogarciacaro Did you push a new REPL bundle after I reverted the FCS default target (see above)? If not, you may have to.
Thanks @ncave! I created the new bundle and now the first issue is fixe :tada: But still having problems with the second one (error if the last value is not consumed). Any ideas?
It's actually not only the last value but any module action with unconsumed values.
@alfonsogarciacaro I'll take a look where it's happening.
Thanks! I can try to reproduce with an unminified bundle and get a more descriptive error if that helps.
@alfonsogarciacaro No need, I can reproduce it even with dotnet. Here is the actual error printed here, if DEBUG is enabled:
Unable to cast object of type 'clo@1504[Microsoft.FSharp.Core.Unit,System.String,System.String]'
to type 'Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.FSharpFunc`2
[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.PrintfImpl+PrintfEnv`3
[Microsoft.FSharp.Core.Unit,System.String,System.String]],
Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.String]]'.
when compiling this:
let f x = x * x
f 3
I'll see if I can pinpoint what's causing it.
Awesome, super fast! It's not totally necessary to "fix" it, but if we could change the error message to something users could understand ("This value is being ignored" or similar) that'd be more than enough.
@alfonsogarciacaro Still looking into it, but in the mean time changing here from "test.fs
" to "test.fsx
" should fix it, at least in the REPL.
It's working, thanks a lot!
I'll close this for now, but please feel free to reopen if you want to keep it as a reminder for the other issue.
Not a serious issue, but just to let you know, apparently now it's necessary to add a module name (e.g.
module Sample
) at the beginning of the file or the REPL will complain. My guess is this has to do with recent changes in @ncave FCS fork.