-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--precompiledLib switch is broken #3818
Comments
opened a PR #3817 to fix those |
Discovered one more problem with pre-compilation. When a precompiled lib has a member with a numeric parameter adorned with a unit of measure such as Js error looks like this:
The reason is because in precompiled code stored in Member links successfully when units of measure are removed from parameter types, as well as without --precompiledLib switch |
@DunetsNM I have to say I'm not very familiar with how the |
@ncave OK will do. I'm experimenting with a possible solution at the moment |
@ncave Repro steps for precompile+UoM bug. It's an unlikely (yet ubiquitous in the project I migrate from Fable 3 to Fable 4) combination of pre-compilation, type extensions and units of measure TO REPRODUCE Download and unpack: Fable_precompile_test.zip Run == Inspect
Inspect
See that Repeating .fs code for better visibility : Lib:
App:
KNOWN WORKAROUNDS
IDEAS OF FIX My first idea was simply to ignore UoM / pretend that it's a naked number primitive in
Looking further. |
Scratch Apparently measure type is still available in the dll only in a different form / as a "Microsoft.FSharp.Core.CompilerServices.MeasureProduct`2" type instead of just "MyLib.Components.KB" It's a known thing, will try to reuse existing code if I can
|
pushed a fix to #3817 while I was there. I think it may still break for aggregate units of measure such as <m/s> but I don't have capacity for it right now and it's an improvement regardless. In fact my impression from working with the compiler is that Fable doesn't try to implement netstandard strictly (probably too ambitious task?), and rather uses case-by-case approach / solves problems as they come |
Closed by #3817 |
Description
After upgrading from Fable 3 to Fable 4 I can no longer use
--precompileLib
switch. I still can precompile the lib but can't link it to my app project, compilation fails.Repro code
I don't have a short repro steps but you can just try to serialize and deserialize an instance of
Fable.AST.Fable.MemberRefInfo
via System.Text.Json. It will throw exception (happens rather early during compilation)Another problem is
Fable.AST.Fable.ValueKind.NumberConstant of obj * NumberKind * info: NumberInfo
. Upon deserialization it deserializes a simple Int32 constant asJsonElement
(which becomes a problem later during compilation)Related information
The text was updated successfully, but these errors were encountered: