diff --git a/message-index/messages/GHC-17335/dsIncompleteRecSel/after/DsIncompleteRecSel.hs b/message-index/messages/GHC-17335/dsIncompleteRecSel/after/DsIncompleteRecSel.hs new file mode 100644 index 00000000..7b002318 --- /dev/null +++ b/message-index/messages/GHC-17335/dsIncompleteRecSel/after/DsIncompleteRecSel.hs @@ -0,0 +1,7 @@ +module DsIncompleteRecSel where + +data T = T1 | T2 {x :: Bool} + +f :: T -> Bool +f T1 = True -- handle the T1 case +f a = x a diff --git a/message-index/messages/GHC-17335/dsIncompleteRecSel/before/DsIncompleteRecSel.hs b/message-index/messages/GHC-17335/dsIncompleteRecSel/before/DsIncompleteRecSel.hs new file mode 100644 index 00000000..aa90b1c5 --- /dev/null +++ b/message-index/messages/GHC-17335/dsIncompleteRecSel/before/DsIncompleteRecSel.hs @@ -0,0 +1,6 @@ +module DsIncompleteRecSel where + +data T = T1 | T2 {x :: Bool} + +f :: T -> Bool +f a = x a diff --git a/message-index/messages/GHC-17335/dsIncompleteRecSel/index.md b/message-index/messages/GHC-17335/dsIncompleteRecSel/index.md new file mode 100644 index 00000000..a668d008 --- /dev/null +++ b/message-index/messages/GHC-17335/dsIncompleteRecSel/index.md @@ -0,0 +1,3 @@ +--- +title: Incomplete record selector application +--- diff --git a/message-index/messages/GHC-17335/index.md b/message-index/messages/GHC-17335/index.md new file mode 100644 index 00000000..1ebf77d8 --- /dev/null +++ b/message-index/messages/GHC-17335/index.md @@ -0,0 +1,13 @@ +--- +title: Incomplete record selector application +summary: A record selector application may not be successful +severity: warning +flag: -Wincomplete-record-selectors +introduced: 9.10.1 +--- + +This warning is triggered when GHC is not certain whether a record selector +application will be successful. This happens when a record selector is not +defined for all constructors of a data type (a.k.a. partial record field +selector) and it is applied to a value whose data constructor can't be proved by +GHC to be one for which the selector is defined.