-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inference for same (but distinct) record types in seq CE (#16040)
* Try TcExprFlex Seems like it could be done better, right now there are two type checking passes for same expression * Fix tests This should be okay, because in both cases, the error message basically says the same thing. * Add a unit test
- Loading branch information
Showing
7 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/FSharp.Compiler.ComponentTests/TypeChecks/SeqTypeCheckTests.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module TypeChecks.SeqTypeCheckTests | ||
|
||
open Xunit | ||
open FSharp.Test.Compiler | ||
|
||
[<Fact>] | ||
let ``Seq expr with impicit yield type checks correctly when two identical record types are present`` () = | ||
FSharp """ | ||
module SeqInference | ||
type A = { X: int } | ||
type B = { X: int } | ||
let l: A list = [ if true then { X = 42 } ] | ||
""" | ||
|> typecheck | ||
|> shouldSucceed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters