FSI type mismatch when order of generic parameters don't match #15175
Labels
Area-Compiler-SigFileGen
generation of signature files - both compiler and IDE
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
If i use explicit generic type arguments in my implementation file, BUT they dont match the order in which they are used in the function, the compiler throws a type mismatch error between the (auto-generated) fsi files and the fs file.
Specifically, if my implementation function declares
'a
then'b
but goes on to use'b
first in its implementation signature, the FSI file wont capture that detail and completely misunderstand the order of generics used.fsi file
implementation file
Results in
Repro steps
Provide the steps required to reproduce the problem:
dotnet new classlib -lang F#
dotnet build -p:OtherFlags="--allsigs"
OR manually create above FSI filedotnet build
Expected behavior
No compiler error, previous
dotnet build
ensures theres no errors present in codeActual behavior
type mismatch compiler error, signature file has the order of generic parameters in order of appearance, regardless of order of implementation
Known workarounds
Implementation MUST declare generic parameters in order of appearance
Related information
Provide any related information (optional):
.NET SDK: 7.0.203 (also tried with prerelease 7.0.400-preview.23226.4)
OS: Windows 11
The text was updated successfully, but these errors were encountered: