Skip to content

Disable CheckInlineValueIsComplete for Fable #10

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/fsharp/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,18 @@ let rec IsPartialExprVal x =
| ValValue (_, a)
| SizeValue(_, a) -> IsPartialExprVal a

#if FABLE_CLI
// Many Fable packages inline functions that access internal values to resolve generics, this is not an issue
// in "normal" Fable compilations but it raises errors when generating an assembly por precompilation. Disable
// for Fable as it's not an actual error (and if is, we assume it's already been raised during type chedking).
let CheckInlineValueIsComplete (_v: Val) _res =
()
#else
let CheckInlineValueIsComplete (v: Val) res =
if v.MustInline && IsPartialExprVal res then
errorR(Error(FSComp.SR.optValueMarkedInlineButIncomplete(v.DisplayName), v.Range))
//System.Diagnostics.Debug.Assert(false, sprintf "Break for incomplete inline value %s" v.DisplayName)
#endif

let check (vref: ValRef) (res: ValInfo) =
CheckInlineValueIsComplete vref.Deref res.ValExprInfo
Expand Down