<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style="--code-editor-font: GitLab Mono, JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>


<style>img {
max-width: 100%; height: auto;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: "GitLab Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: "GitLab Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";'>
<div class="content">

<h3 style="margin-top: 20px; margin-bottom: 10px;">
Marge Bot pushed to branch master at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
Commits:
</h4>
<ul>
<li>
<strong style="font-weight: bold;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/503fd6478086144a00e424d02cc21773a8e0ee24">503fd647</a></strong>
<div>
<span> by Bartłomiej Cieślar </span> <i> at 2023-07-26T17:23:10-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #333238; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>This MR is an implementation of the proposal #516.

It adds a warning -Wincomplete-record-selectors for usages of a record
field access function (either a record selector or getField @"rec"),
while trying to silence the warning whenever it can be sure that a constructor
without the record field would not be invoked (which would otherwise cause
the program to fail). For example:

    data T = T1 | T2 {x :: Bool}

    f a = x a -- this would throw an error

    g T1 = True
    g a = x a -- this would not throw an error

    h :: HasField "x" r Bool => r -> Bool
    h = getField @"x"

    j :: T -> Bool
    j = h -- this would throw an error because of the `HasField`
          -- constraint being solved

See the tests DsIncompleteRecSel* and TcIncompleteRecSel for more examples of the warning.
See Note [Detecting incomplete record selectors] in GHC.HsToCore.Expr for implementation details
</pre>
</li>
</ul>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
30 changed files:
</h4>
<ul>
<li class="file-stats">
<a href="#b452cc5181a4af3460c43a4e3e4b5edaa238b4e0">
compiler/GHC/Core/ConLike.hs
</a>
</li>
<li class="file-stats">
<a href="#2e5692f568fd7b67a6b172e2a60469da8392508c">
compiler/GHC/Driver/Flags.hs
</a>
</li>
<li class="file-stats">
<a href="#774d88050336ef660c7a219fb06c480c2fc639bc">
compiler/GHC/Driver/Session.hs
</a>
</li>
<li class="file-stats">
<a href="#cf4176c2d1c1c5ac2d46a9fa5fe02a24bc407c3c">
compiler/GHC/HsToCore/Errors/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#6eaba7424490cb26d74e0dab0f6fd7bc3537dca7">
compiler/GHC/HsToCore/Errors/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#6bdd5abc649727f2a802bc96ce5c276de19d3726">
compiler/GHC/HsToCore/Expr.hs
</a>
</li>
<li class="file-stats">
<a href="#c8a27621f82549165d8946ae8e9f467660958059">
compiler/GHC/HsToCore/Monad.hs
</a>
</li>
<li class="file-stats">
<a href="#36e7b8d61b4fae8f65fca3984d01eb4076712f2b">
compiler/GHC/HsToCore/Pmc.hs
</a>
</li>
<li class="file-stats">
<a href="#3050d0d7e4a9e93aebcc1fe0bed898ca6dac5502">
compiler/GHC/HsToCore/Pmc/Check.hs
</a>
</li>
<li class="file-stats">
<a href="#0036eccef60579fe5f653a10eeb8bf9869964cf4">
compiler/GHC/HsToCore/Pmc/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#648f978c68cdea9aa07ff6362494dbc95b04d4e6">
compiler/GHC/HsToCore/Pmc/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#06ff7bac58fd8cfe0c17b81963b03f4cce86a065">
compiler/GHC/IfaceToCore.hs
</a>
</li>
<li class="file-stats">
<a href="#1dd9c7a6bbc222c976a6ec1c4b772232ae60f7e5">
compiler/GHC/Tc/Errors/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#cdba811872892f235fe7059df1a6c538fba60816">
compiler/GHC/Tc/Errors/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#aebe2c3d616f6843166d2657bed048898add6bc9">
compiler/GHC/Tc/Instance/Class.hs
</a>
</li>
<li class="file-stats">
<a href="#60f69bb5bc0ef8edf7d13518a1e48f7d36236318">
compiler/GHC/Tc/Solver/Dict.hs
</a>
</li>
<li class="file-stats">
<a href="#0c6b585a8a21f8340a85ca2cef89c4b1bf5a8953">
compiler/GHC/Tc/Solver/Monad.hs
</a>
</li>
<li class="file-stats">
<a href="#5ed3ecf19a26af612b8100b2639f8e153f580fe9">
compiler/GHC/Tc/TyCl/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#c9446951223982bc58852a8f524a62b6011c482f">
compiler/GHC/Types/Error.hs
</a>
</li>
<li class="file-stats">
<a href="#e2c828ee9e003df518a07b05beaa6971e5c62eb0">
compiler/GHC/Types/Error/Codes.hs
</a>
</li>
<li class="file-stats">
<a href="#38110817cdbc9a34d2b80a14070cabc7515c808a">
compiler/GHC/Types/Id/Info.hs
</a>
</li>
<li class="file-stats">
<a href="#49adaedbb694748035a5c7111adf7480c110ea21">
compiler/GHC/Types/TyThing.hs
</a>
</li>
<li class="file-stats">
<a href="#523e258f899a29c551e69a88115587d32ba73db1">
docs/users_guide/9.10.1-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#56cab10ba9d31c526f47a492a4151a878077dc2d">
docs/users_guide/9.8.1-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#e16ae6db99f98868d3603a0c7df0bb6a793a330d">
docs/users_guide/using-warnings.rst
</a>
</li>
<li class="file-stats">
<a href="#0f05347a081689dd671f549d132a6befea34241e">
testsuite/tests/plugins/all.T
</a>
</li>
<li class="file-stats">
<a href="#ac81369c4365151ae61cd5b3467686ba1b3d0031">
<span class="new-file">
+
testsuite/tests/pmcheck/should_compile/DsIncompleteRecSel1.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#f6623e5df68557cae77670581ab8eca2711c62d6">
<span class="new-file">
+
testsuite/tests/pmcheck/should_compile/DsIncompleteRecSel1.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#4850e88cbfd9504fd75963d91d9e45b8395014dc">
<span class="new-file">
+
testsuite/tests/pmcheck/should_compile/DsIncompleteRecSel2.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#f6432ee5bce264af5d819798a403912ddfd1911a">
<span class="new-file">
+
testsuite/tests/pmcheck/should_compile/DsIncompleteRecSel2.stderr
</span>
</a>
</li>
</ul>
<h5 style="margin-top: 10px; margin-bottom: 10px; font-size: 0.875rem;">
The diff was not included because it is too large.
</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/503fd6478086144a00e424d02cc21773a8e0ee24">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.haskell.org">gitlab.haskell.org</a>. <a href="https://gitlab.haskell.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.haskell.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.haskell.org/ghc/ghc/-/commit/503fd6478086144a00e424d02cc21773a8e0ee24"}}</script>


</p>
</div>
</body>
</html>