Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10103 closed bug (fixed)

Outdated comment (or bug?) in `types/TyCon.hs`

Reported by: thomie Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler (Type checker) Version: 7.8.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by thomie)

The docstring for coreExpandTyCon_maybe says it should do something different than tcExpandTyCon_maybe, but it doesn't:

-- ^ Used to create the view the /typechecker/ has on 'TyCon's.
-- We expand (closed) synonyms only, cf. 'coreExpandTyCon_maybe'
tcExpandTyCon_maybe = ...

-- ^ Used to create the view /Core/ has on 'TyCon's. We expand
-- not only closed synonyms like 'tcExpandTyCon_maybe',
-- but also non-recursive @newtype@s
coreExpandTyCon_maybe tycon tys = tcExpandTyCon_maybe tycon tys

If the code is correct, and the comment is just outdated, than Note [Newtype eta] and the docstrings for Type.coreView and Type.tcView should be updated as well.

The last big change to coreExpandTyCon_maybe was made in commit fdf8656855d26105ff36bdd24d41827b05037b91.

Change History (6)

comment:1 Changed 5 years ago by thomie

Description: modified (diff)
Summary: Outdated comment (or bug?) in TyCon.hsOutdated comment (or bug?) in `types/TyCon.hs`

comment:2 Changed 5 years ago by thomie

Component: CompilerCompiler (Type checker)

The section 'Views of types' in this wiki page is outdated as well.

comment:3 Changed 5 years ago by Simon Peyton Jones <simonpj@…>

In 9b3239f81261f05ee3285c1b9dcbe113635145ef/ghc:

Improve comments on coreView/tcView, and combine coreExpandTyCon/tcExpandTyCon

This is minor stuff triggered by Trac #10103.

* Fix outdated comments on tcView/coreView (we should really combine
  them with a new name, but I'll leave that slightly-disruptive change
  for now)

* Combine tcExpandTyCon_maybe and coreExpandTyCon_maybe (which were identical)
  into expandSynTyCon_maybe

* A few more comment fixups

comment:4 Changed 5 years ago by simonpj

Resolution: fixed
Status: newclosed

I've fixed both, thanks.

comment:5 Changed 5 years ago by thomie


comment:6 Changed 4 years ago by thoughtpolice


Milestone renamed

Note: See TracTickets for help on using tickets.