Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
05e6a2d9
Commit
05e6a2d9
authored
Jan 21, 2023
by
Tom Ellis
Committed by
Marge Bot
Jan 24, 2023
Browse files
Clarify where `f` is defined
parent
1c050ed2
Pipeline
#62039
canceled with stages
in 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/using-warnings.rst
View file @
05e6a2d9
...
...
@@ -2057,10 +2057,13 @@ of ``-W(no-)*``.
:since: 8.4
The option :ghc-flag:`-Wpartial-fields` warns about record fields that could
fail when accessed via a lacking constructor. The function ``f`` below will
fail when applied to ``Bar``, so the compiler will emit a warning at its
definition when :ghc-flag:`-Wpartial-fields` is enabled.
The option :ghc-flag:`-Wpartial-fields` warns about a record field
`f` that is defined in some, but not all, the contructors of a
data type, because `f`'s record selector function may fail. For
exampe, the record selector function `f`, defined in the `Foo`
constructor record below, will fail when applied to ``Bar``, so
the compiler will emit a warning at its definition when
:ghc-flag:`-Wpartial-fields` is enabled.
The warning is suppressed if the field name begins with an underscore. ::
...
...
Marge Bot
💬
@marge-bot
mentioned in merge request
!9766 (closed)
·
Jan 24, 2023
mentioned in merge request
!9766 (closed)
mentioned in merge request !9766
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment