-
Notifications
You must be signed in to change notification settings - Fork 845
Closed
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
This code is meant to be invalid, since additional restrictions of the form :> SomeType should not be used in type intersection:
let f (x: 't when 't :> ABRAKADABRAA & #seq<int>) = ()However, it compiles successfully, and you can use any not existing type name instead of ABRAKADABRA.
After decompilation, the false constraint is not present in the final build.
As you can see from the white identifier and unused open, the compiler doesn't even return a symbol for an existing type.
Reproducible in the main branch via test:
[<Fact>]
let test () =
Fsx """
let f (x: 't when 't :> ABRAKADABRAA & #seq<int>) = ()
"""
|> withLangVersion80
|> typecheck
|> shouldSucceed.NET 8.0.100
kerams, DedSec256 and BoundedChenn31edgarfgp
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.

