X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Frename%2FRnNames.lhs;h=8189c2a03d20d5e347018160d87f8f21c320f0a1;hp=d85089f7224839a3022969f56babad746e22e999;hb=1e9a92161ce58d3eb1d35b9b5f9f67e4d1bc03cf;hpb=9b1dbf2663d88b696c80e8e0f2e7f58e9c80d3f1 diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index d85089f..8189c2a 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -949,18 +949,34 @@ lookupImpDeprec dflags hpt pit gre case gre_par gre of ParentIs p -> mi_dep_fn iface p -- its parent*, is deprec'd NoParent -> Nothing - Nothing - | isWiredInName name -> Nothing - -- We have not necessarily loaded the .hi file for a - -- wired-in name (yet), although we *could*. - -- And we never deprecate them - - | otherwise -> pprPanic "lookupDeprec" (ppr name) - -- By now all the interfaces should have been loaded + + Nothing -> Nothing -- See Note [Used names with interface not loaded] where name = gre_name gre \end{code} +Note [Used names with interface not loaded] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +By now all the interfaces should have been loaded, +because reportDeprecations happens after typechecking. +However, it's still (just) possible to to find a used +Name whose interface hasn't been loaded: + +a) It might be a WiredInName; in that case we may not load + its interface (although we could). + +b) It might be GHC.Real.fromRational, or GHC.Num.fromInteger + These are seen as "used" by the renamer (if -fno-implicit-prelude) + is on), but the typechecker may discard their uses + if in fact the in-scope fromRational is GHC.Read.fromRational, + (see tcPat.tcOverloadedLit), and the typechecker sees that the type + is fixed, say, to GHC.Base.Float (see Inst.lookupSimpleInst). + In that obscure case it won't force the interface in. + +In both cases we simply don't permit deprecations; +this is, after all, wired-in stuff. + + %********************************************************* %* * Unused names