Option "-ddump-rn-ast" dumps imports and exports too
authorAlan Zimmerman <alan.zimm@gmail.com>
Wed, 13 Sep 2017 12:02:42 +0000 (14:02 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 19 Sep 2017 21:09:19 +0000 (17:09 -0400)
Summary:
Previously the renamed source decls only were dumped, now the imports, exports
and doc_hdr are too.

Test Plan: ./validate

Reviewers: bgamari, austin

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14197

Differential Revision: https://phabricator.haskell.org/D3949

(cherry picked from commit 2fe6f6baba70de071c391bccc77197ab4f81064d)

compiler/main/HscMain.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnMonad.hs
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
testsuite/tests/parser/should_compile/T14189.stderr

index 43dc5a1..906fce3 100644 (file)
@@ -382,25 +382,47 @@ type RenamedStuff =
         (Maybe (HsGroup Name, [LImportDecl Name], Maybe [LIE Name],
                 Maybe LHsDocString))
 
--- | Rename and typecheck a module, additionally returning the renamed syntax
-hscTypecheckRename :: HscEnv -> ModSummary -> HsParsedModule
-                   -> IO (TcGblEnv, RenamedStuff)
-hscTypecheckRename hsc_env mod_summary rdr_module = runHsc hsc_env $ do
-    tc_result <- hscTypecheck True mod_summary (Just rdr_module)
+-- -----------------------------------------------------------------------------
+-- | If the renamed source has been kept, extract it. Dump it if requested.
+extract_renamed_stuff :: TcGblEnv -> Hsc (TcGblEnv, RenamedStuff)
+extract_renamed_stuff tc_result = do
 
-        -- This 'do' is in the Maybe monad!
+    -- This 'do' is in the Maybe monad!
     let rn_info = do decl <- tcg_rn_decls tc_result
                      let imports = tcg_rn_imports tc_result
                          exports = tcg_rn_exports tc_result
                          doc_hdr = tcg_doc_hdr tc_result
                      return (decl,imports,exports,doc_hdr)
 
+    dflags <- getDynFlags
+    liftIO $ dumpIfSet_dyn dflags Opt_D_dump_rn_ast "Renamer" $
+                           text (showAstData NoBlankSrcSpan rn_info)
+
     return (tc_result, rn_info)
 
+
+-- -----------------------------------------------------------------------------
+-- | Rename and typecheck a module, additionally returning the renamed syntax
+hscTypecheckRename :: HscEnv -> ModSummary -> HsParsedModule
+                   -> IO (TcGblEnv, RenamedStuff)
+hscTypecheckRename hsc_env mod_summary rdr_module = runHsc hsc_env $ do
+    tc_result <- hscTypecheck True mod_summary (Just rdr_module)
+    extract_renamed_stuff tc_result
+
+
 hscTypecheck :: Bool -- ^ Keep renamed source?
              -> ModSummary -> Maybe HsParsedModule
              -> Hsc TcGblEnv
 hscTypecheck keep_rn mod_summary mb_rdr_module = do
+    tc_result <- hscTypecheck' keep_rn mod_summary mb_rdr_module
+    _ <- extract_renamed_stuff tc_result
+    return tc_result
+
+
+hscTypecheck' :: Bool -- ^ Keep renamed source?
+              -> ModSummary -> Maybe HsParsedModule
+              -> Hsc TcGblEnv
+hscTypecheck' keep_rn mod_summary mb_rdr_module = do
     hsc_env <- getHscEnv
     let hsc_src = ms_hsc_src mod_summary
         dflags = hsc_dflags hsc_env
index 97e0d9f..363bd8c 100644 (file)
@@ -2499,9 +2499,7 @@ loadUnqualIfaces hsc_env ictxt
 
 rnDump :: (Outputable a, Data a) => a -> TcRn ()
 -- Dump, with a banner, if -ddump-rn
-rnDump rn = do { traceOptTcRn Opt_D_dump_rn (mkDumpDoc "Renamer" (ppr rn))
-               ; traceOptTcRn Opt_D_dump_rn_ast
-                 (mkDumpDoc "Renamer" (text (showAstData NoBlankSrcSpan rn))) }
+rnDump rn = do { traceOptTcRn Opt_D_dump_rn (mkDumpDoc "Renamer" (ppr rn)) }
 
 tcDump :: TcGblEnv -> TcRn ()
 tcDump env
index 53a8c8c..6cf8075 100644 (file)
@@ -223,8 +223,9 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this
 
              maybe_rn_syntax :: forall a. a -> Maybe a ;
              maybe_rn_syntax empty_val
-                | keep_rn_syntax = Just empty_val
-                | otherwise      = Nothing ;
+                | dopt Opt_D_dump_rn_ast dflags = Just empty_val
+                | keep_rn_syntax                = Just empty_val
+                | otherwise                     = Nothing ;
 
              gbl_env = TcGblEnv {
                 tcg_th_topdecls      = th_topdecls_var,
index c873ee1..0457a18 100644 (file)
 
 ==================== Renamer ====================
 
-(HsGroup 
- (ValBindsOut 
-  [
-   ((,) 
-    (NonRecursive) {Bag(Located (HsBind Name)): 
+(Just 
+ ((,,,) 
+  (HsGroup 
+   (ValBindsOut 
     [
-     ({ DumpRenamedAst.hs:11:1-23 }
-      (FunBind 
-       ({ DumpRenamedAst.hs:11:1-4 }{Name: main:DumpRenamedAst.main{v}}) 
-       (MG 
-        ({ DumpRenamedAst.hs:11:1-23 }
-         [
+     ((,) 
+      (NonRecursive) {Bag(Located (HsBind Name)): 
+      [
+       ({ DumpRenamedAst.hs:11:1-23 }
+        (FunBind 
+         ({ DumpRenamedAst.hs:11:1-4 }{Name: main:DumpRenamedAst.main{v}}) 
+         (MG 
           ({ DumpRenamedAst.hs:11:1-23 }
-           (Match 
-            (FunRhs 
-             ({ DumpRenamedAst.hs:11:1-4 }{Name: main:DumpRenamedAst.main{v}}) 
-             (Prefix) 
-             (NoSrcStrict)) 
-            [] 
-            (Nothing) 
-            (GRHSs 
-             [
-              ({ DumpRenamedAst.hs:11:6-23 }
-               (GRHS 
-                [] 
-                ({ DumpRenamedAst.hs:11:8-23 }
-                 (HsApp 
-                  ({ DumpRenamedAst.hs:11:8-15 }
-                   (HsVar 
-                    ({ DumpRenamedAst.hs:11:8-15 }{Name: base:System.IO.putStrLn{v}}))) 
-                  ({ DumpRenamedAst.hs:11:17-23 }
-                   (HsLit 
-                    (HsString 
-                     (SourceText "\"hello\"") {FastString: "hello"})))))))] 
-             ({ <no location info> }
-              (EmptyLocalBinds)))))]) 
-        [] 
-        (PlaceHolder) 
-        (FromSource)) 
-       (WpHole) {NameSet: 
-       []} 
-       []))]})] 
-  []) 
- [] 
- [
-  (TyClGroup 
-   [
-    ({ DumpRenamedAst.hs:5:1-30 }
-     (DataDecl 
-      ({ DumpRenamedAst.hs:5:6-10 }{Name: main:DumpRenamedAst.Peano{tc}}) 
-      (HsQTvs 
-       [] 
-       [] {NameSet: 
-       []}) 
-      (Prefix) 
-      (HsDataDefn 
-       (DataType) 
-       ({ <no location info> }
-        []) 
-       (Nothing) 
-       (Nothing) 
-       [
-        ({ DumpRenamedAst.hs:5:14-17 }
-         (ConDeclH98 
-          ({ DumpRenamedAst.hs:5:14-17 }{Name: main:DumpRenamedAst.Zero{d}}) 
-          (Nothing) 
-          (Just 
-           ({ <no location info> }
-            [])) 
-          (PrefixCon 
-           []) 
-          (Nothing))),
-        ({ DumpRenamedAst.hs:5:21-30 }
-         (ConDeclH98 
-          ({ DumpRenamedAst.hs:5:21-24 }{Name: main:DumpRenamedAst.Succ{d}}) 
-          (Nothing) 
-          (Just 
-           ({ <no location info> }
-            [])) 
-          (PrefixCon 
            [
-            ({ DumpRenamedAst.hs:5:26-30 }
-             (HsTyVar 
-              (NotPromoted) 
-              ({ DumpRenamedAst.hs:5:26-30 }{Name: main:DumpRenamedAst.Peano{tc}})))]) 
-          (Nothing)))] 
-       ({ <no location info> }
-        [])) 
-      (True) {NameSet: 
-      [{Name: main:DumpRenamedAst.Peano{tc}}]}))] 
+            ({ DumpRenamedAst.hs:11:1-23 }
+             (Match 
+              (FunRhs 
+               ({ DumpRenamedAst.hs:11:1-4 }{Name: main:DumpRenamedAst.main{v}}) 
+               (Prefix) 
+               (NoSrcStrict)) 
+              [] 
+              (Nothing) 
+              (GRHSs 
+               [
+                ({ DumpRenamedAst.hs:11:6-23 }
+                 (GRHS 
+                  [] 
+                  ({ DumpRenamedAst.hs:11:8-23 }
+                   (HsApp 
+                    ({ DumpRenamedAst.hs:11:8-15 }
+                     (HsVar 
+                      ({ DumpRenamedAst.hs:11:8-15 }{Name: base:System.IO.putStrLn{v}}))) 
+                    ({ DumpRenamedAst.hs:11:17-23 }
+                     (HsLit 
+                      (HsString 
+                       (SourceText "\"hello\"") {FastString: "hello"})))))))] 
+               ({ <no location info> }
+                (EmptyLocalBinds)))))]) 
+          [] 
+          (PlaceHolder) 
+          (FromSource)) 
+         (WpHole) {NameSet: 
+         []} 
+         []))]})] 
+    []) 
    [] 
-   []),
-  (TyClGroup 
    [
-    ({ DumpRenamedAst.hs:7:1-39 }
-     (FamDecl 
-      (FamilyDecl 
-       (ClosedTypeFamily 
-        (Just 
+    (TyClGroup 
+     [
+      ({ DumpRenamedAst.hs:5:1-30 }
+       (DataDecl 
+        ({ DumpRenamedAst.hs:5:6-10 }{Name: main:DumpRenamedAst.Peano{tc}}) 
+        (HsQTvs 
+         [] 
+         [] {NameSet: 
+         []}) 
+        (Prefix) 
+        (HsDataDefn 
+         (DataType) 
+         ({ <no location info> }
+          []) 
+         (Nothing) 
+         (Nothing) 
          [
-          ({ DumpRenamedAst.hs:8:3-36 }
-           (TyFamEqn 
-            ({ DumpRenamedAst.hs:8:3-8 }{Name: main:DumpRenamedAst.Length{tc}}) 
-            (HsIB 
-             [{Name: a{tv}},{Name: as{tv}}] 
+          ({ DumpRenamedAst.hs:5:14-17 }
+           (ConDeclH98 
+            ({ DumpRenamedAst.hs:5:14-17 }{Name: main:DumpRenamedAst.Zero{d}}) 
+            (Nothing) 
+            (Just 
+             ({ <no location info> }
+              [])) 
+            (PrefixCon 
+             []) 
+            (Nothing))),
+          ({ DumpRenamedAst.hs:5:21-30 }
+           (ConDeclH98 
+            ({ DumpRenamedAst.hs:5:21-24 }{Name: main:DumpRenamedAst.Succ{d}}) 
+            (Nothing) 
+            (Just 
+             ({ <no location info> }
+              [])) 
+            (PrefixCon 
              [
-              ({ DumpRenamedAst.hs:8:10-17 }
-               (HsParTy 
-                ({ DumpRenamedAst.hs:8:11-16 }
-                 (HsOpTy 
-                  ({ DumpRenamedAst.hs:8:11 }
-                   (HsTyVar 
-                    (NotPromoted) 
-                    ({ DumpRenamedAst.hs:8:11 }{Name: a{tv}}))) 
-                  ({ DumpRenamedAst.hs:8:13 }{Name: ghc-prim:GHC.Types.:{(w) d}}) 
-                  ({ DumpRenamedAst.hs:8:15-16 }
-                   (HsTyVar 
-                    (NotPromoted) 
-                    ({ DumpRenamedAst.hs:8:15-16 }{Name: as{tv}})))))))] 
-             (True)) 
-            (Prefix) 
-            ({ DumpRenamedAst.hs:8:21-36 }
-             (HsAppTy 
-              ({ DumpRenamedAst.hs:8:21-24 }
+              ({ DumpRenamedAst.hs:5:26-30 }
                (HsTyVar 
                 (NotPromoted) 
-                ({ DumpRenamedAst.hs:8:21-24 }{Name: main:DumpRenamedAst.Succ{d}}))) 
-              ({ DumpRenamedAst.hs:8:26-36 }
-               (HsParTy 
-                ({ DumpRenamedAst.hs:8:27-35 }
-                 (HsAppTy 
-                  ({ DumpRenamedAst.hs:8:27-32 }
-                   (HsTyVar 
-                    (NotPromoted) 
-                    ({ DumpRenamedAst.hs:8:27-32 }{Name: main:DumpRenamedAst.Length{tc}}))) 
-                  ({ DumpRenamedAst.hs:8:34-35 }
-                   (HsTyVar 
-                    (NotPromoted) 
-                    ({ DumpRenamedAst.hs:8:34-35 }{Name: as{tv}}))))))))))),
-          ({ DumpRenamedAst.hs:9:3-24 }
-           (TyFamEqn 
-            ({ DumpRenamedAst.hs:9:3-8 }{Name: main:DumpRenamedAst.Length{tc}}) 
-            (HsIB 
-             [] 
-             [
-              ({ DumpRenamedAst.hs:9:10-12 }
-               (HsExplicitListTy 
-                (Promoted) 
-                (PlaceHolder) 
-                []))] 
-             (True)) 
-            (Prefix) 
-            ({ DumpRenamedAst.hs:9:21-24 }
-             (HsTyVar 
-              (NotPromoted) 
-              ({ DumpRenamedAst.hs:9:21-24 }{Name: main:DumpRenamedAst.Zero{d}})))))])) 
-       ({ DumpRenamedAst.hs:7:13-18 }{Name: main:DumpRenamedAst.Length{tc}}) 
-       (HsQTvs 
-        [{Name: k{tv}}] 
-        [
-         ({ DumpRenamedAst.hs:7:20-30 }
-          (KindedTyVar 
-           ({ DumpRenamedAst.hs:7:21-22 }{Name: as{tv}}) 
-           ({ DumpRenamedAst.hs:7:27-29 }
-            (HsListTy 
-             ({ DumpRenamedAst.hs:7:28 }
-              (HsTyVar 
-               (NotPromoted) 
-               ({ DumpRenamedAst.hs:7:28 }{Name: k{tv}})))))))] {NameSet: 
-        []}) 
-       (Prefix) 
-       ({ DumpRenamedAst.hs:7:32-39 }
-        (KindSig 
-         ({ DumpRenamedAst.hs:7:35-39 }
-          (HsTyVar 
-           (NotPromoted) 
-           ({ DumpRenamedAst.hs:7:35-39 }{Name: main:DumpRenamedAst.Peano{tc}}))))) 
-       (Nothing))))] 
+                ({ DumpRenamedAst.hs:5:26-30 }{Name: main:DumpRenamedAst.Peano{tc}})))]) 
+            (Nothing)))] 
+         ({ <no location info> }
+          [])) 
+        (True) {NameSet: 
+        [{Name: main:DumpRenamedAst.Peano{tc}}]}))] 
+     [] 
+     []),
+    (TyClGroup 
+     [
+      ({ DumpRenamedAst.hs:7:1-39 }
+       (FamDecl 
+        (FamilyDecl 
+         (ClosedTypeFamily 
+          (Just 
+           [
+            ({ DumpRenamedAst.hs:8:3-36 }
+             (TyFamEqn 
+              ({ DumpRenamedAst.hs:8:3-8 }{Name: main:DumpRenamedAst.Length{tc}}) 
+              (HsIB 
+               [{Name: a{tv}},{Name: as{tv}}] 
+               [
+                ({ DumpRenamedAst.hs:8:10-17 }
+                 (HsParTy 
+                  ({ DumpRenamedAst.hs:8:11-16 }
+                   (HsOpTy 
+                    ({ DumpRenamedAst.hs:8:11 }
+                     (HsTyVar 
+                      (NotPromoted) 
+                      ({ DumpRenamedAst.hs:8:11 }{Name: a{tv}}))) 
+                    ({ DumpRenamedAst.hs:8:13 }{Name: ghc-prim:GHC.Types.:{(w) d}}) 
+                    ({ DumpRenamedAst.hs:8:15-16 }
+                     (HsTyVar 
+                      (NotPromoted) 
+                      ({ DumpRenamedAst.hs:8:15-16 }{Name: as{tv}})))))))] 
+               (True)) 
+              (Prefix) 
+              ({ DumpRenamedAst.hs:8:21-36 }
+               (HsAppTy 
+                ({ DumpRenamedAst.hs:8:21-24 }
+                 (HsTyVar 
+                  (NotPromoted) 
+                  ({ DumpRenamedAst.hs:8:21-24 }{Name: main:DumpRenamedAst.Succ{d}}))) 
+                ({ DumpRenamedAst.hs:8:26-36 }
+                 (HsParTy 
+                  ({ DumpRenamedAst.hs:8:27-35 }
+                   (HsAppTy 
+                    ({ DumpRenamedAst.hs:8:27-32 }
+                     (HsTyVar 
+                      (NotPromoted) 
+                      ({ DumpRenamedAst.hs:8:27-32 }{Name: main:DumpRenamedAst.Length{tc}}))) 
+                    ({ DumpRenamedAst.hs:8:34-35 }
+                     (HsTyVar 
+                      (NotPromoted) 
+                      ({ DumpRenamedAst.hs:8:34-35 }{Name: as{tv}}))))))))))),
+            ({ DumpRenamedAst.hs:9:3-24 }
+             (TyFamEqn 
+              ({ DumpRenamedAst.hs:9:3-8 }{Name: main:DumpRenamedAst.Length{tc}}) 
+              (HsIB 
+               [] 
+               [
+                ({ DumpRenamedAst.hs:9:10-12 }
+                 (HsExplicitListTy 
+                  (Promoted) 
+                  (PlaceHolder) 
+                  []))] 
+               (True)) 
+              (Prefix) 
+              ({ DumpRenamedAst.hs:9:21-24 }
+               (HsTyVar 
+                (NotPromoted) 
+                ({ DumpRenamedAst.hs:9:21-24 }{Name: main:DumpRenamedAst.Zero{d}})))))])) 
+         ({ DumpRenamedAst.hs:7:13-18 }{Name: main:DumpRenamedAst.Length{tc}}) 
+         (HsQTvs 
+          [{Name: k{tv}}] 
+          [
+           ({ DumpRenamedAst.hs:7:20-30 }
+            (KindedTyVar 
+             ({ DumpRenamedAst.hs:7:21-22 }{Name: as{tv}}) 
+             ({ DumpRenamedAst.hs:7:27-29 }
+              (HsListTy 
+               ({ DumpRenamedAst.hs:7:28 }
+                (HsTyVar 
+                 (NotPromoted) 
+                 ({ DumpRenamedAst.hs:7:28 }{Name: k{tv}})))))))] {NameSet: 
+          []}) 
+         (Prefix) 
+         ({ DumpRenamedAst.hs:7:32-39 }
+          (KindSig 
+           ({ DumpRenamedAst.hs:7:35-39 }
+            (HsTyVar 
+             (NotPromoted) 
+             ({ DumpRenamedAst.hs:7:35-39 }{Name: main:DumpRenamedAst.Peano{tc}}))))) 
+         (Nothing))))] 
+     [] 
+     [])] 
+   [] 
+   [] 
+   [] 
    [] 
-   [])] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [])
+   [] 
+   [] 
+   [] 
+   [] 
+   []) 
+  [
+   ({ DumpRenamedAst.hs:3:8-21 }
+    (ImportDecl 
+     (NoSourceText) 
+     ({ DumpRenamedAst.hs:3:8-21 }{ModuleName: Prelude}) 
+     (Nothing) 
+     (False) 
+     (False) 
+     (False) 
+     (True) 
+     (Nothing) 
+     (Nothing)))] 
+  (Nothing) 
+  (Nothing)))
+
 
index a2c7d92..9a9b87e 100644 (file)
 
 ==================== Renamer ====================
 
-(HsGroup 
- (ValBindsOut 
-  [] 
-  []) 
- [] 
- [
-  (TyClGroup 
+(Just 
+ ((,,,) 
+  (HsGroup 
+   (ValBindsOut 
   [] 
+    []) 
+   [] 
    [
-    ({ T14189.hs:6:1-42 }
-     (DataDecl 
-      ({ T14189.hs:6:6-11 }{Name: main:T14189.MyType{tc}}) 
-      (HsQTvs 
-       [] 
-       [] {NameSet: 
-       []}) 
-      (Prefix) 
-      (HsDataDefn 
-       (DataType
-       ({ <no location info> }
-        []
-       (Nothing) 
-       (Nothing
-       [
-        ({ T14189.hs:6:15-20 }
-         (ConDeclH98 
-          ({ T14189.hs:6:15-16 }{Name: main:T14189.MT{d}}) 
-          (Nothing) 
-          (Just 
-           ({ <no location info> }
-            [])) 
-          (PrefixCon 
-           [
-            ({ T14189.hs:6:18-20 }
-             (HsTyVar 
-              (NotPromoted) 
-              ({ T14189.hs:6:18-20 }{Name: ghc-prim:GHC.Types.Int{(w) tc}})))]) 
-          (Nothing))),
-        ({ T14189.hs:6:24-25 }
-         (ConDeclH98 
-          ({ T14189.hs:6:24-25 }{Name: main:T14189.NT{d}}) 
-          (Nothing) 
-          (Just 
-           ({ <no location info> }
-            [])) 
-          (PrefixCon 
-           []
-          (Nothing))),
-        ({ T14189.hs:6:29-42 }
-         (ConDeclH98 
-          ({ T14189.hs:6:29 }{Name: main:T14189.F{d}}) 
-          (Nothing) 
-          (Just 
-           ({ <no location info> }
-            [])) 
-          (RecCon 
-           ({ T14189.hs:6:31-42 }
-            [
-             ({ T14189.hs:6:33-40 }
-              (ConDeclField 
-               [
-                ({ T14189.hs:6:33 }
-                 (FieldOcc 
+    (TyClGroup 
+     [
+      ({ T14189.hs:6:1-42 }
+       (DataDecl 
+        ({ T14189.hs:6:6-11 }{Name: main:T14189.MyType{tc}}) 
+        (HsQTvs 
+         [] 
+         [] {NameSet: 
+         []}) 
+        (Prefix
+        (HsDataDefn 
+         (DataType
+         ({ <no location info> }
+          []
+         (Nothing) 
+         (Nothing) 
+         [
+          ({ T14189.hs:6:15-20 }
+           (ConDeclH98 
+            ({ T14189.hs:6:15-16 }{Name: main:T14189.MT{d}}) 
+            (Nothing) 
+            (Just 
+             ({ <no location info> }
+              [])) 
+            (PrefixCon 
+             [
+              ({ T14189.hs:6:18-20 }
+               (HsTyVar 
+                (NotPromoted) 
+                ({ T14189.hs:6:18-20 }{Name: ghc-prim:GHC.Types.Int{(w) tc}})))]) 
+            (Nothing))),
+          ({ T14189.hs:6:24-25 }
+           (ConDeclH98 
+            ({ T14189.hs:6:24-25 }{Name: main:T14189.NT{d}}) 
+            (Nothing) 
+            (Just 
+             ({ <no location info> }
+              [])
+            (PrefixCon 
+             []) 
+            (Nothing))),
+          ({ T14189.hs:6:29-42 }
+           (ConDeclH98 
+            ({ T14189.hs:6:29 }{Name: main:T14189.F{d}}) 
+            (Nothing) 
+            (Just 
+             ({ <no location info> }
+              [])) 
+            (RecCon 
+             ({ T14189.hs:6:31-42 }
+              [
+               ({ T14189.hs:6:33-40 }
+                (ConDeclField 
+                 [
                   ({ T14189.hs:6:33 }
-                   (Unqual {OccName: f})) {Name: main:T14189.f{v}}))] 
-               ({ T14189.hs:6:38-40 }
-                (HsTyVar 
-                 (NotPromoted) 
-                 ({ T14189.hs:6:38-40 }{Name: ghc-prim:GHC.Types.Int{(w) tc}}))) 
-               (Nothing)))])) 
-          (Nothing)))] 
-       ({ <no location info> }
-        [])) 
-      (True) {NameSet: 
-      [{Name: ghc-prim:GHC.Types.Int{(w) tc}}]}))] 
+                   (FieldOcc 
+                    ({ T14189.hs:6:33 }
+                     (Unqual {OccName: f})) {Name: main:T14189.f{v}}))] 
+                 ({ T14189.hs:6:38-40 }
+                  (HsTyVar 
+                   (NotPromoted) 
+                   ({ T14189.hs:6:38-40 }{Name: ghc-prim:GHC.Types.Int{(w) tc}}))) 
+                 (Nothing)))])) 
+            (Nothing)))] 
+         ({ <no location info> }
+          [])) 
+        (True) {NameSet: 
+        [{Name: ghc-prim:GHC.Types.Int{(w) tc}}]}))] 
+     [] 
+     [])] 
+   [] 
+   [] 
+   [] 
+   [] 
    [] 
-   [])] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [] 
- [])
+   [] 
+   [] 
+   [] 
+   []) 
+  [
+   ({ T14189.hs:1:8-13 }
+    (ImportDecl 
+     (NoSourceText) 
+     ({ T14189.hs:1:8-13 }{ModuleName: Prelude}) 
+     (Nothing) 
+     (False) 
+     (False) 
+     (False) 
+     (True) 
+     (Nothing) 
+     (Nothing)))] 
+  (Just 
+   [
+    ({ T14189.hs:3:3-15 }
+     (IEThingWith 
+      ({ T14189.hs:3:3-8 }
+       (IEName 
+        ({ T14189.hs:3:3-8 }{Name: main:T14189.MyType{tc}}))) 
+      (NoIEWildcard) 
+      [
+       ({ T14189.hs:3:13-14 }
+        (IEName 
+         ({ T14189.hs:3:13-14 }{Name: main:T14189.NT{d}})))] 
+      [
+       ({ T14189.hs:3:11 }
+        (FieldLabel {FastString: "f"} 
+         (False) {Name: main:T14189.f{v}}))]))]) 
+  (Nothing)))
+