Skip to content

Commit 20ab6da

Browse files
gdziadkiewiczbaronfel
authored andcommitted
* #6928 - Removed SByte and Byte from default case requirement and added check for complete match.
* Upgrade new tests (#6928)
1 parent 3742740 commit 20ab6da

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/fsharp/PatternMatchCompilation.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,7 @@ let (|ConstNeedsDefaultCase|_|) c =
528528
| Const.Decimal _
529529
| Const.String _
530530
| Const.Single _
531-
| Const.Double _
532-
| Const.SByte _
533-
| Const.Byte _
531+
| Const.Double _
534532
| Const.Int16 _
535533
| Const.UInt16 _
536534
| Const.Int32 _
@@ -1084,6 +1082,8 @@ let CompilePatternBasic
10841082

10851083
match simulSetOfDiscrims with
10861084
| DecisionTreeTest.Const (Const.Bool _b) :: _ when simulSetOfCases.Length = 2 -> None
1085+
| DecisionTreeTest.Const (Const.Byte _) :: _ when simulSetOfCases.Length = 256 -> None
1086+
| DecisionTreeTest.Const (Const.SByte _) :: _ when simulSetOfCases.Length = 256 -> None
10871087
| DecisionTreeTest.Const (Const.Unit) :: _ -> None
10881088
| DecisionTreeTest.UnionCase (ucref, _) :: _ when simulSetOfCases.Length = ucref.TyconRef.UnionCasesArray.Length -> None
10891089
| DecisionTreeTest.ActivePatternCase _ :: _ -> error(InternalError("DecisionTreeTest.ActivePatternCase should have been eliminated", matchm))

0 commit comments

Comments
 (0)