-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Description
See #135 (comment)
Copied below
Yes. To reproduce this problem, there is a branch: https://github.com/fsprojects/SQLProvider/tree/providedtypes-expr
SQLProvider has multiple database connections to different databases.
So there is an utility function to fetch runtime connection string from cache.
- Previous commit uses the old API for this expression, run build.cmd and it works.
- The last commit uses the new API for this expression, run build.cmd and it fails.
We are using directly this project's files, they are located after a build at:
paket-files\sourcefiles\fsprojects\FSharp.TypeProviders.SDK\src\
It fails on runtime while running test from solution SQLProvider.Tests.sln file QueryTests.fs.
Those can be also debugged with F# interactive.
The error: Exception of type 'System.Collections.Generic.KeyNotFoundException' was thrown. from
gtd.Metadata.Methods.FindByNameAndArity(name, types.Length)
|> Array.find (fun md -> eqTypesAndILTypesWithInst types args md.ParameterTypes)...but the real problem is at recursive expression tree parsing, where it tries to parse different kind of logics to Microsoft.FSharp.Quotations.FSharpExpr.
This time it fails to PrintFormat which comes from source code node "failwithf" but if the quotation would be different, it would fail to something else.
For SQLProvider this was a minor problem, I just excluded those overrides from .NET Standard version as their usage is so minor anyways, and kind of anti-pattern, but on the other hand I would like to maintain the old features for backward-compatibility.