Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

-Wincomplete-record-selectors broken in GHC 9.14.1
## Summary `-Wincomplete-record-selectors` is broken in 9.14.1 (and HEAD). ## Steps to reproduce ```haskell {-# OPTIONS_GHC -Werror=incomplete-record-selectors #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE GADTs #-} data X = A | B data T (x :: X) where TA :: { ta :: Int } -> T A TB :: { tb :: Int } -> T B ok :: T A -> Int ok = ta fails :: T A -> Int fails = (.ta) ``` Trying to compile this yields: ``` [1 of 2] Compiling Main ( ../inc.hs, interpreted )[interactive-session] ../inc.hs:16:9: error: [GHC-86894] [-Wincomplete-record-selectors, Werror=incomplete-record-selectors] Selecting the record field ‘ta’ may fail for the following constructors: TB | 16 | fails = (.ta) | ``` There's another reproducer that's probably the same bug, but it's even more bizarre: ```haskell {-# LANGUAGE DataKinds #-} import GHC.Generics import Optics.Core data T = T1 | T2 { t2 :: Int } deriving Generic wut :: T -> Maybe Int wut = preview $ gafield @"t2" ``` Compiling this in ghci yields: ``` >>> :r [1 of 2] Compiling Main ( ../inc.hs, interpreted )[interactive-session] ../inc.hs:10:17: warning: [GHC-86894] [-Wincomplete-record-selectors] Selecting the record field ‘t2’ may fail for the following constructors: T1 | 10 | wut = preview $ gafield @"t2" | ^^^^^^^ Ok, one module reloaded. ``` Well, yes, that's why this code generates an affine traversal that correctly handles constructors that don't have `t2`: ``` >>> wut $ T1 Nothing >>> wut $ T2 1 Just 1 ``` Yet GHC still complains. ## Expected behavior No warning/error in `fails` and `wut`. ## Environment * GHC version used: 9.14.1
issue