From 32ff3a340cea25dcf3ab1bd1b92ea8e5d27cc2fc Mon Sep 17 00:00:00 2001 From: Alfonso Garcia-Caro Date: Wed, 8 Jun 2022 11:46:11 +0900 Subject: [PATCH] Disable CheckInlineValueIsComplete for Fable (#10) --- src/Compiler/Optimize/Optimizer.fs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 62e8078e8cb..6b7c0085247 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -494,10 +494,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