Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8ab424

Browse files
committed
Add tests that expose the bug
1 parentbc65945 commitd8ab424

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

‎tests/fsharp/typecheck/sigs/neg102.bsl‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ neg102.fs(18,14,18,22): typecheck error FS0025: Incomplete pattern matches on th
99

1010
neg102.fs(22,14,22,22): typecheck error FS0025: Incomplete pattern matches on this expression.For example, the value 'Some (EnumABC.C)' may indicate a casenot covered by the pattern(s).
1111

12-
neg102.fs(29,14,29,22): typecheck errorFS0104:Enums may take values outside known cases.For example, the value 'enum<EnumABC> (2)' may indicate a casenot covered by the pattern(s).
12+
neg102.fs(27,14,27,22): typecheck errorFS0025: Incomplete pattern matches on this expression.For example, the value 'System.DateTimeKind.Utc' may indicate a casenot covered by the pattern(s).
1313

14-
neg102.fs(34,14,34,22): typecheck error FS0104:Enums may take values outside known cases.For example, the value 'Some (enum<EnumABC> (2))' may indicate a casenot covered by the pattern(s).
14+
neg102.fs(32,14,32,22): typecheck error FS0104:Enums may take values outside known cases.For example, the value 'enum<EnumABC> (2)' may indicate a casenot covered by the pattern(s).
15+
16+
neg102.fs(37,14,37,22): typecheck error FS0104:Enums may take values outside known cases.For example, the value 'Some (enum<EnumABC> (2))' may indicate a casenot covered by the pattern(s).
17+
18+
neg102.fs(44,14,44,22): typecheck error FS0104:Enums may take values outside known cases.For example, the value 'enum<System.DateTimeKind> (3)' may indicate a casenot covered by the pattern(s).

‎tests/fsharp/typecheck/sigs/neg102.fs‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type UnionAB = A | B
44

55
moduleFS0025=
66
// All of these should emit warning FS0025 ("Incomplete pattern match....")
7-
7+
88

99
letf1=function
1010
| UnionAB.A->"A"
@@ -23,6 +23,9 @@ module FS0025 =
2323
| Some(EnumABC.A)| Some(EnumABC.B)->"A|B"
2424
| None->"neither"
2525

26+
// try a non-F#-defined enum
27+
letf6=function System.DateTimeKind.Unspecified->0
28+
2629
moduleFS0104=
2730
// These should emit warning FS0104 ("Enums may take values outside of known cases....")
2831

@@ -35,4 +38,10 @@ module FS0104 =
3538
| Some(EnumABC.A)->"A"
3639
| Some(EnumABC.B)->"B"
3740
| Some(EnumABC.C)->"C"
38-
| None->"none"
41+
| None->"none"
42+
43+
// try a non-F#-defined enum
44+
letf3=function
45+
| System.DateTimeKind.Unspecified->"Unspecified"
46+
| System.DateTimeKind.Utc->"Utc"
47+
| System.DateTimeKind.Local->"Local"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp