Skip to content

fix: Use string interpolation instead of sprintf to create run start … - #21

Draft
Numpsy wants to merge 1 commit into
fable-hub:mainfrom
Numpsy:interp_one
Draft

Numpsy wants to merge 1 commit into
fable-hub:mainfrom
Numpsy:interp_one

Conversation

@Numpsy

@Numpsy Numpsy commented Sep 20, 2026

Copy link
Copy Markdown

…time

Hi,
Not sure if there is interest in this officially, but:

I thought I'd have a go at running a Scriptorium test project as a .NET NativeAOT build to see if it would work (As not using reflection and such for finding the tests should make that easier), and it failed with

Unhandled exception. System.NotSupportedException: 'Microsoft.FSharp.Core.PrintfImpl+Specializations`3[Microsoft.FSharp.Core.Unit,System.String,System.String].CaptureFinal1[System.Int32](Microsoft.FSharp.Core.PrintfImpl+Step[])' is missing native code. MethodInfo.MakeGenericMethod() is not compatible with AOT compilation. Inspect and fix AOT related warnings that were generated when the app was published. For more information see https://aka.ms/nativeaot-compatibility
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x2a
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) + 0x3f
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc[a](PrintfImpl.FormatSpecifier, a, Type[], Type, Tuple`5) + 0x39b
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFuncFactoryAux(FSharpList`1, String, Type, Int32&) + 0x134
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFuncFactoryAux(FSharpList`1, String, Type, Int32&) + 0xf8
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFuncFactoryAux(FSharpList`1, String, Type, Int32&) + 0xf8
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFunctionFactory() + 0x72
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.GetCurriedPrinterFactory() + 0x2e
   at Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.GetCurriedStringPrinter() + 0x2f
   at Scriptorium.Quill.Advanced.printRunReport(TestRunReport) + 0x1f3
   at Scriptorium.Quill.Reporters.console@706-1.Invoke(TestRunReport) + 0x9
   at Scriptorium.Quill.Advanced.notifyRunComplete(FSharpList`1, TestRunReport) + 0x26
   at <StartupCode$Scriptorium-Quill>.$Quill.runTestsWith@740-4.Invoke(FSharpList`1) + 0xa1
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[T,TResult](AsyncActivation`1, TResult, FSharpFunc`2) + 0x24
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2) + 0x5e
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() + 0x45
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken, FSharpAsync`1, FSharpOption`1) + 0x44c

If I change it to use a string interpolation instead then it works - I can run the test project for Quill itself as NativeAOT then - so as the rest of the function is using interpolations already I thought I'd see if that's an acceptable change.

Thanks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant