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
Type unification issues across different .NET profiles for type providers #99
Comments
Is this going to be solved in v4? |
When you want to use Serilog and FSharp.Configuration (SharpYaml) together, you run into this as well |
Here is a minimal repro: https://github.com/CumpsD/staticlinking-bug Serilog is profile 259 FSharp.Configuration is a TP, uses SharpYaml, SharpYaml is profile 136 At a certain point, the compiler runs into https://github.com/CumpsD/staticlinking-bug/blob/master/src/bug/Bug.fs#L13 and tries to access |
@CumpsD Many thanks for the minimal repro (long ago!). I've submitted a fix to this bug. |
Can we close this now? (for folks like me going over bugs trying to fix, would be nice to close things, thanks!) |
Yes |
Am I right that if I still see this issue on and generative TP that want to support full .net and pcl (xamarin) should provide assemblies compiled for both frameworks, because pcl assemblies references from full .net may break compilation in VS2015 and lower? |
Originally opened at CodePlex bylatkin
Originally logged on github here.
The immediate issue is that types used by generative type providers are not being unified properly with types used in portable class libraries, resulting in erroneous compile errors "Static linking may not use assembly that targets different profile."
Attached is a repro project which fails to build with error "Static linking may not use assembly that targets different profile". It requires a SQL DB named "Test" with the following table:
When "newrec" is from SqlDataConnection type provider, representing SQL table with CreatedDate column of type [datetime], and "twt" is from LinqToTwitter portable library, the following line causes static linking error:
newrec.CreatedDate <- twt.CreatedAt
Commenting out this line works around the problem. Adding back just the below line will cause repro again:
Commentary from Vlad: I’d say that current behavior is a very crude workaround for the fact that generated types obtained from type providers are not rescoped but rather merged as is. Consequences of this is hard to predict, a few that I’ve seen were crashes on the late stages of the codegen when compiler tried and failed to find matching mscorlib types in System.Runtime and vice versa.
File Attachement
The text was updated successfully, but these errors were encountered: