Changes between Version 14 and Version 15 of Records/OverloadedRecordFields/Implementation


Ignore:
Timestamp:
Jul 30, 2013 8:06:21 AM (2 years ago)
Author:
adamgundry
Comment:

unused imports

Legend:

Unmodified
Added
Removed
Modified
  • Records/OverloadedRecordFields/Implementation

    v14 v15  
    6363
    6464
    65 == Known bugs ==
     65== Unused imports ==
    6666
    67 Unused imports and generation of the minimal import list (`warnUnusedImportDecls` in `RnNames`) show selector names rather than labels. This is a pain to fix, as there is no easy way to get from a selector `Name` to the `OccName` of the label. We could add the label to the `RecSelId` constructor of `IdDetails`. Or perhaps there is a way to keep track of label/selector relationships when renaming imports?
     67Unused imports and generation of the minimal import list (`RnNames.warnUnusedImportDecls`) currently show selector names rather than labels. We may need to create a mapping from dfun names to field labels (cf. `kids_env` in `RnNames.reportUnusedNames`) to know how to print them. Moreover, things are a bit trickier with `-XOverloadedRecordFields` enabled. Quoting SLPJ:
    6868
     69On unused imports, it's not just an implementation question. 
     70
     71{{{
     72module A where
     73  data T = MkT { x,y:Int }
     74
     75module B where
     76  data S = MkS { x,y::Bool }
     77
     78module C where
     79  import A( T(x) )
     80  import B( S(x) )
     81
     82  foo :: T -> Int
     83  foo r = r.x + 2
     84}}}
     85
     86Now, do we expect to report the 'x' in S(x) import as unused?  Actually the entire 'import B' is unused.  Only the typechecker will eventually know that.  But I think the type checker does actually record which instances are used, so perhaps we can make use of that info to give accurate unused-import info.
     87
     88
     89
     90== Outstanding bugs ==
    6991
    7092Some of the ghci tests fail with the following messages:
     
    84106* rename/should_fail/T5892a (accept changed output)
    85107
     108
    86109== To do ==
    87110