-
Notifications
You must be signed in to change notification settings - Fork 790
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
Unexpected error when refencing an F# project from a C# project #16359
Comments
@francotiveron If you try to build the solution, does it still build with the build gesture? Or does that fail too? |
@jasonmalinowski It fails with the same error |
Then can you do a command line build and pass the /bl switch? That'll produce a binary log file that we can investigate further with. That file can potentially contain private info, so if you want to email me the file directly my email is on my GitHub profile. |
msbuild.binlog (481K) sent to your email |
Thanks for sending over the binlog. I see that The NinjaTrader.Core from "C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Core.dll" " is being passed to the compiler. But when P1 was being built the underlying assembly resolution logic did say this:
This makes me think the problem here is there are two versions of NinjaTrader.Core floating around: one has a strong name (PublicKeyToken = 0907d8af90186095) and one does not have a strong name, and those are considered different per assembly resolution logic. The follow up question then is "where did the two copies come from?" Unfortunately your binlog doesn't show a build for P2 or P3 (just that they're up to date), but if you do a clean and build again, does the problem go away? Otherwise we might need a new binlog where not only passing /bl you are also passing /t:Rebuild to force a rebuild. |
(and marking this as Area-Compilers rather than Area-IDE since it's definitely not an IDE problem. I suspect this is still a build going funny in some way though and not really a compiler issue either.) |
Solution Cleaned |
@dotnet/fsharp-team-msft do you think you can take a look at this as a next step of investigation? It seems that the F# assembly is being recorded as having a reference to an assembly with a public key token, but the build shows it's getting the same input as the C# compiler. I don't see where the public key token for the reference is coming from anywhere else, so it almost feels like this is an F# compiler bug (although I don't know how!) |
So how do I fix it? Or is it a bug? |
@francotiveron Don't know yet, but at this point I'm not sure it's a Roslyn issue. We're getting the F# team to take a look. |
I'm not entirely sure how can that happen, but 17.7 ships with quite old compiler, we've had a bunch of fixes since. Does the same issue show with 17.8/17.9? @jasonmalinowski also - isn't Fsc task in binlog showing what was passed to it as reference when msbuild is invoking it? |
Yeah that's why I'm confused. I see the reference going in that looks like it doesn't have a public key token. But later when we try processing the output of it, it seems like output did have one. And to be very clear, I can't explain how the compiler could make a mistake like that, but I'm not seeing any alternative either. :-/ Actually @francotiveron that might be one more thing to ask: can you upload the P2.dll file that gets built? You can upload that here, no reason to email. |
@francotiveron , could I get the binary log file to look at. |
I've shared the logs internally. |
@francotiveron , So ... from the error message it looks as if the F# compiler is writing out the reference to NinjaTrader.Core incorrectly. When compiling P2.dll
Would it be possible for you to provide p1.dll and p2.dll so that I can look at them locally, You can put them in a zip and add them as an attachment to this conversation. It would also be very useful to be able to examine ninjatrader.core.dll, but their terms of use specifically prohibit decompilation So perhaps if you could run these commands on the assembly and provide the output:
and:
It's interesting to me, that the particular public key, has appeared in several issues on the internet, so I harbor the suspicion that whatever we are doing, is a bit more subtle than I outlined above. thanks Kevin Ransom. |
P2.dll attached. P1.dll is not generated because of the error we are dealing with Slight edit .... |
@vzarytovskii now using VS 17.8,2 - error persists |
Okay, I think I understand what is going on here. I believe the ninjatrader.core.dll has been obfuscated, when we import it we think it is a strong signed assembly, even though the dumpbin shows that it is clearly not. I'm guessing the obfuscator zero's out the strong signed flag, and the public key record as well as the KeyFile attribute filename. So the resulting assembly doesn't look quite the same as if it was originally unsigned. When we write out the reference because we thought it was signed when we imported it, we write the assembly reference into P2.dll with the public key set to the bytes we thought represented the public key on import. I don't think this is a regression, it's probably worked this way for a long time. l will try to work on a fix tomorrow, it shouldn't be too tricky. Thanks for persevering with the issue Kevin |
How do I install this version without waiting for an update of Visual Studio? |
@francotiveron, IMO the easiest for you ("works on your machine") only:
After this, if it is all fine:
|
build fails
|
@francotiveron, sorry you are facing issues, I just made a clean build and it comes green: Could you share which VS version you have installed? I ran the command from VS 2022 command prompt and I'm having 17.8 and 17.9 (preview) installed on the machine, just as a disclaimer, this repository generally needs pretty recent version of VS 2022, I sometimes have to update but don't remember if the error is explicit. Your version in this ticket seems rather old, could you try updating your VS 2022 installation and try again, from a VS 2022 developer command prompt so we are on same page? |
@smoothdeveloper I am using VS 17.8.2, the latest non-preview. I have updated the initial post to reflect this. |
* squash * squash * move adhoc tests and clean errors * fix up constraint solving and adhoc testing * remove tests * fantomas * skip fails * fix tests * fix up test baselines for change in order in checking * update tests * don't overwrite baselines * fix some test failures * skip warnings * skip warnings * fix warning logic * fix tests * fix sizes * fix build * fantomas and validation update * corrections to self-use * [WIP] [RFC FS-1060] Nullness checking (applied to codebase) (#15265) * enablement * enablement * fix build * fix build * fantomas * selective adoption * Revert "[WIP] [RFC FS-1060] Nullness checking (applied to codebase) (#15265)" (#15309) This reverts commit 559c058. * Fixes * Feature/nullness - parsing of constraints (#15753) * Feature/nullness - parsing of constraints for: 'T: not null .... syntax in Type argument specification appType | NULL ... for specifying types * applying changed syntax * positive.fs updated * positive.fs paranthesis * fixing "parse warning Remove spaces between the type name and type parameter, e.g. "C<'T>", not "C <'T>". Type parameters must be placed directly adjacent to the type name." * positive .bsl updated * Please mighty fantomas * Feature nullness metadata export (#15981) * fix merge mistake * fix build * fantomas * bsl fix * il tests update * fix test * tests fixed * fantomas * fix tests * trim test * trimming test * trim check * now? * IL tests * il tests * trim test * trim * one more time * Merge main to feature/nullness (#16366) * Fixes #16359 - correctly handle imports with 0 length public key tokens (#16363) * Parser: recover on unfinished record decls, fix field ranges (#16357) * Parser: recover on unfinished record decls, fix field ranges * Fantomas * Better diagnostic ranges for fields * More parser tests * Update surface area * Fix xml doc test * Update baselines * Update src/Compiler/SyntaxTree/SyntaxTree.fsi Co-authored-by: Edgar Gonzalez <edgargonzalez.info@gmail.com> * Add MutableKeyword to SynFieldTrivia. (#11) * Simplify * Fantomas --------- Co-authored-by: Edgar Gonzalez <edgargonzalez.info@gmail.com> Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> --------- Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com> Co-authored-by: Eugene Auduchinok <eugene.auduchinok@jetbrains.com> Co-authored-by: Edgar Gonzalez <edgargonzalez.info@gmail.com> Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com> * syntax tree layout * Nullness-related aggressive trimming of FSharp.Core (#16387) * Merge main to feature/nullness (#16397) * [main] Update dependencies from dnceng/internal/dotnet-optimization (#16150) * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231019.5 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.23515.2 -> To Version 1.0.0-prerelease.23519.5 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231019.5 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.23515.2 -> To Version 1.0.0-prerelease.23519.5 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231021.3 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.23515.2 -> To Version 1.0.0-prerelease.23521.3 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231021.3 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.23515.2 -> To Version 1.0.0-prerelease.23521.3 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [main] Update dependencies from dotnet/arcade (#16241) * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231106.5 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23556.5 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231114.4 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23564.4 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231130.1 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23580.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231130.1 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23580.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231130.1 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23580.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231130.1 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23580.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231130.1 Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.23463.1 -> To Version 8.0.0-beta.23580.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23426.1 -> To Version 1.0.0-beta.23475.1 (parent: Microsoft.DotNet.Arcade.Sdk --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com> Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com> * Name resolution: don't search extension members in type abbreviations (#16390) * Name resolution: don't search extension members in type abbreviations * Add test * Revert "[main] Update dependencies from dotnet/arcade (#16241)" (#16396) This reverts commit f219a99. * trimmed size updated --------- Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com> Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com> Co-authored-by: Eugene Auduchinok <eugene.auduchinok@jetbrains.com> * Nullness interop - import of C#-emitted metadata (#16423) * Nullness - include in QuickInfo and in general in "typeEnc" (string representation of a type) (#16555) * failing test * todo for IL import * explanation added * il meta parsing * flags evaluation * you shall passs * evaluateFirstOrderNullnessAndAdvance * import il type with nullness * type import * IL nullness import fields, props, events, method args, method return types - nullness imported from IL * test rename * fantomas * get stack trace on error * split ilmethod's type * fix crashes for Csharp style extensions * solve coexistance of nullness and Is* properties of DUs * updating tests * clean tests * fantomas * fantomas one more time * importing nullness for generic typars * print failing ivals, let's see * write even more! * isolated failing test - combo of module rec, signature file, IVT * another attempt * format * test * hide tests * Remove 'specialname' for DU case tester * format * warning as error * update baseline netcore * nullable errors not in desktop framework * surface area, trimming * surface area * cosmetic cleanup & annotations * Rename to ILMethParentTypeInfo * making vMapFold tail recursive * physical nullnessEquiv * format * Commenting SkipNullness usages * Nullness work - activity module * Remove strict generic 'T:null' import * Null|NonNull pattern also for regular compilation * Backported Null|NonNull active pattern * one more time * revert * Show nullness in quickinfo and in general in type representations * Merge main to feature/nullness (#16539) Merge of main + syntax conflict resolution + semantic conflict resolution * release notes * Fix ILType.Array import (#16585) * Nullness - reading+writing metadata for 'inherits' and interface implementations (#16597) * ILGenerator test case * Nullness :: Format string %s should allow nullable string (#16656) * Nullness:: Unchecked.nonNull for FSharp.Core (#16654) * Nullness :: Pattern matching with null should mark input for subsequent clauses as without null + support for matching nulls in tuples (#16659) * Feature nullness - support overrides of nullness annotation in the imported object hierarchy (#16711) * Improve type inference w.r.t. nullness in printing (#16681) * Update tests/AheadOfTime/Trimming/check.ps1 * Fix merge errors * il tests reflecting visibility change * Nullness feature :: New warning for functions insisting on a (WithNull) argument + typar equality fix (#16853) Null-handling functions now have the option to raise a warning when they are called with a known-to-be-withoutNull argument. That way, API authors (incl. Fsharp.Core) can help with cleaning code from superflous null checks. While doing it, a strange error kept coming when using Option.ofObj and other functions with a (T | null) typar. It turned out that nullness info had been striped from nullable typars on stripTyparEqnsAux calls in some occasions, leading to treating all typars as 'KnownWithoutNull' even when that was not true. * Feature nullness - propper guards against ` | null ` on unsupported types (#16907) TODOs resolved: * mkAppTy resolved * mkFunTyWithNullness * delayed checks of post-infered values for nullness-carrying capabilities * Feature nullness :: warn also for 'obj' type (since it can be infered for null literal) (#16962) * Nullness feature :: various bugfixes (#17080) * Bugfix - matching aliased nullable should strip nullness Eliminating nullness after pattern matching null (that is , for subsequent patterns) must visit contents of abbreviations as well. Otherwise it does not work with the Maybe<T> type whcih we use in the compiler. * Making 'obj' work with new 'not null' constraints in fslib functions Bugfix: obj cannot be passed to generic typars which require T: not null, such as the NonNull active pattern. This commit fixes it. * Bugfix - false 'useless null' warning in nested applications Error fixed: Error on useless null checkwith nullness constraint propagation in code like this:let meTry = Option.ofObj (Path.GetDirectoryName "")`. The warning about 'useless Option.ofObj' points to the string literal, ignoring the string literal is first passed to an API which may return null * Fix import for C# extension methods Bugfix for: C# extension methods which put "?" on the this argument are wrongly interpreted by moving the nullability elsewhere. See AsMemory<T> from System.Memory.dll , this treats byteArray.ToMemory() as resulting in a Memory<byte | null> which is clearly wrong. Also, this now allows to call C# extension methods with ?this to be invoked on a nullable value. * LinkedList First,Last bugfix There was a bug of LinkedList .First and .Last properties not returning nullable nodes. This was fixed by improved byte import in previous commit, adding a regression test for guarding this. * Bugfix: Solve nullness for typars This fixes a bug where `not null` generic constraint was incorrectly passed between two typars:`T1 | null` with not null constraint on T1, and T2 without constraints. This occured when calling Option.ofObj(..) when the inner expression caused solving of generic type arguments, e.g. after (|>) or (id) function. This uses additional inference variable to unify them. * updating IL tests * One more try * surface area * trimmed size * trimmed size * fix issues for plain 'dotnet build Fsharp.Compiler.Service.sln` * update FSharpCoreShippedPackageVersionValue * Wkraround attributetargets issue by using 'obj'. This removes 3x box and adds 1x unbox. * Feature nullness :: Bugfixes (#17102) * Ignore Nullness applied on structs (C# allows T? when when T is a struct) * Bigfix: Working with CLI events in Fsharp * Bugfix: Mutable binding initially assigned to null should not need type annotation * Solving `let mutable cache = null` via type inference * Enforcing TyparConstraint.IsReferenceType when WithNull type is used * Nullness-related constraint consistency * Bugfix for emitting Nullable attrs for C# * Automated command ran: fantomas Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> * Feature nullness :: Try infer without null even when function/method arg is marked as nullable (#17269) * Feature nullness :: apply nullness annotations to usages of 'obj' in Fsharp.Core (#17284) * resolve build error from auto-merge * Feature nullness :: Cleanups, Test reorg, fix incrementalbuild cache behavior (#17309) * Fix TransparentCompiler - it should report PostInference errors if it only encountered a warning (reported as an error due to confiig) * fix build issues * resolve semantic merge error * Nullness subsumption when used for contravariant typars * fix nullness plain build (#17404) * Update docs/release-notes/.FSharp.Compiler.Service/8.0.300.md * Update release notes * Update check.ps1 * Update check.ps1 --------- Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com> Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com> Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org> Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com> Co-authored-by: Eugene Auduchinok <eugene.auduchinok@jetbrains.com> Co-authored-by: Edgar Gonzalez <edgargonzalez.info@gmail.com> Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com> Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: psfinaki <psfinaki@users.noreply.github.com>
Version Used:
Microsoft Visual Studio Professional 2022
Version 17.8.2
VisualStudio.17.Release/17.8.2+34322.80
Microsoft .NET Framework
Version 4.8.09037
Installed Version: Professional
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 17.8.358.6298
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.8.358.6298
Azure App Service Tools v3.0.0
Azure Data Lake Tools for Visual Studio 2.6.5000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 17.8.358.6298
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.6.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter 17.0.23262.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Extensibility Message Bus 1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
File Differ 3.0.49
The easiest way to diff two files directly in Solution Explorer
ILSpy.AddIn 1.0
Integration of the ILSpy Decompiler into Visual Studio.
Microsoft Azure Hive Query Language Service 2.6.5000.0
Language service for Hive query
Microsoft Azure Stream Analytics Language Service 2.6.5000.0
Language service for Azure Stream Analytics
Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Mono Debugging for Visual Studio 17.8.17 (957fbed)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 6.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Office Developer Tools for Visual Studio 17.6.34024.01
Microsoft Office Developer Tools for Visual Studio
Python - Django support 17.0.23262.1
Provides templates and integration for the Django web framework.
Python - Profiling support 17.0.23262.1
Profiling support for Python projects.
Python with Pylance 17.0.23262.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Razor (ASP.NET Core) 17.8.3.2353105+f0a326f3e15b2370371693a76fd379635387c74d
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.8.119.0
Microsoft SQL Server Data Tools
Text Macros for Visual Studio 2012-2022 1.18
Brings back text-editing macro support in Visual Studio 2012-2022
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript Tools 17.0.20920.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.8.0-beta.23475.2+10f956e631a1efc0f7f5e49c626c494cd32b1f50
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info
Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.
Xamarin 17.8.0.155 (d17-8@7042beb)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.8.3.6 (remotes/origin/d17-8@eccf46a291)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 17.8.16 (830b56a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: d9a6e87
Java.Interop: xamarin/java.interop/d17-5@149d70fe
SQLite: xamarin/sqlite@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d
Xamarin.iOS and Xamarin.Mac SDK 16.4.0.23 (9defd91b3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Steps to Reproduce:
1.
Create solution with 3 projects
P2.fsproj
P3.csproj
P1.csproj
Class2.fs
Class3.cs
Class1.cs
Note:
Expected Behavior:
Code should compile without errors
Actual Behavior:
Visual studio complains on the instantiation of Class2 in Class1, but not on Class3; the error is
The text was updated successfully, but these errors were encountered: