FS0025: Incomplete pattern match
This message is given when pattern matching is incomplete.
Given the following definition:
type Faucet =
| Hot
| Cold
let faucet = Hot
And match expression:
let incompleteFaucetString =
match faucet with
| Hot -> "Hot"
The compiler will yield the following message:
FS0025: Incomplete pattern matches on this expression. For example, the value 'Cold' may indicate a case not covered by the pattern(s).
To resolve, you can either complete the pattern match:
let completeFaucetString =
match faucet with
| Hot -> "Hot"
| Cold -> "Cold"
Or, introduce a wildcard, _
(use with caution)
let wildcardFaucetString =
match faucet with
| Hot -> "Hot"
| _ -> "Other"
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: