Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 378
    • Merge Requests 378
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14549

Closed
Open
Opened Dec 01, 2017 by akegalj@trac-akegalj

RecordWildCards doesn't work properly in repl

Prelude> :set -XRecordWildCards
Prelude> data Test = Test { t1 :: Int, t2 :: Int } deriving Show
Prelude> t1 = 2
Prelude> Test { t2 = 2, ..}

<interactive>:15:1: warning: [-Wmissing-fields]
    • Fields of 'Test' not initialised: t1
    • In the expression: Test {t2 = 2, ..}
      In an equation for 'it': it = Test {t2 = 2, ..}

<interactive>:15:1: warning: [-Wmissing-fields]
    • Fields of 'Test' not initialised: t1
    • In the expression: Test {t2 = 2, ..}
      In an equation for 'it': it = Test {t2 = 2, ..}
Test {t1 = *** Exception: <interactive>:15:1-18: Missing field in record construction t1

I would expect above to return Test {t1 = 2, t2 = 2} instead of throwing an error.

Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority lowest
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14549