diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 0bf4df1c2569..f1897b992d96 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -528,11 +528,7 @@ let (|ConstNeedsDefaultCase|_|) c = | Const.Decimal _ | Const.String _ | Const.Single _ - | Const.Double _ - | Const.SByte _ - | Const.Byte _ - | Const.Int16 _ - | Const.UInt16 _ + | Const.Double _ | Const.Int32 _ | Const.UInt32 _ | Const.Int64 _ @@ -1081,9 +1077,12 @@ let CompilePatternBasic match getDiscrimOfPattern p with | Some discrim -> List.exists (isDiscrimSubsumedBy g amap exprm discrim) simulSetOfDiscrims | None -> false - match simulSetOfDiscrims with | DecisionTreeTest.Const (Const.Bool _b) :: _ when simulSetOfCases.Length = 2 -> None + | DecisionTreeTest.Const (Const.Byte _) :: _ when simulSetOfCases.Length = 256 -> None + | DecisionTreeTest.Const (Const.SByte _) :: _ when simulSetOfCases.Length = 256 -> None + | DecisionTreeTest.Const (Const.Int16 _) :: _ when simulSetOfCases.Length = 65536 -> None + | DecisionTreeTest.Const (Const.UInt16 _) :: _ when simulSetOfCases.Length = 65536 -> None | DecisionTreeTest.Const (Const.Unit) :: _ -> None | DecisionTreeTest.UnionCase (ucref, _) :: _ when simulSetOfCases.Length = ucref.TyconRef.UnionCasesArray.Length -> None | DecisionTreeTest.ActivePatternCase _ :: _ -> error(InternalError("DecisionTreeTest.ActivePatternCase should have been eliminated", matchm))