[Git][ghc/ghc][wip/T24049] users-guide: Fix discussion of -Wpartial-fields
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Tue Oct 3 14:55:43 UTC 2023
Ben Gamari pushed to branch wip/T24049 at Glasgow Haskell Compiler / GHC
Commits:
2ed20a3f by Ben Gamari at 2023-10-03T14:55:41+00:00
users-guide: Fix discussion of -Wpartial-fields
* fix a few typos
* add a new example showing when the warning fires
* clarify the existing example
* point out -Wincomplete-record-selects
Fixes #24049.
- - - - -
1 changed file:
- docs/users_guide/using-warnings.rst
Changes:
=====================================
docs/users_guide/using-warnings.rst
=====================================
@@ -2158,7 +2158,7 @@ of ``-W(no-)*``.
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
+ data type, because ``f``\ 's record selector function may fail. For
example, 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
@@ -2170,6 +2170,9 @@ of ``-W(no-)*``.
data Foo = Foo { _f :: Int } | Bar
+ Another related warning is :ghc-flag:`-Wincomplete-record-selectors`,
+ which warns at use sites rather than definition sites.
+
.. ghc-flag:: -Wunused-packages
:shortdesc: warn when package is requested on command line, but not needed.
:type: dynamic
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ed20a3f717a515ff968c277b44b6f32383621f8
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ed20a3f717a515ff968c277b44b6f32383621f8
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231003/67c9d7a7/attachment-0001.html>
More information about the ghc-commits
mailing list