# Ticket #2787: ghcbug.txt

File ghcbug.txt, 11.1 KB (added by BenMoseley, 8 years ago) |
---|

Line | |
---|---|

1 | {-# LANGUAGE TypeFamilies, GADTs #-} |

2 | module GHCBug ( |

3 | PVR(..), |

4 | Core(..), |

5 | analyseCore |

6 | ) |

7 | where |

8 | |

9 | data Core a where Ctr :: Core Double |

10 | data PVR a = PVR a deriving (Eq, Show) |

11 | |

12 | |

13 | class Sub a where |

14 | type AssocSyn a :: * -> * |

15 | |

16 | instance Sub Double where |

17 | type AssocSyn Double = PVR |

18 | |

19 | |

20 | analyseCore :: Core a -> ((AssocSyn a) a) |

21 | analyseCore Ctr = pvr |

22 | where |

23 | -- GHC panics if we use the below as the type sig for 'pvr' |

24 | pvr :: PVR ~ AssocSyn a => (AssocSyn a) a |

25 | -- pvr :: (AssocSyn a) a |

26 | pvr = undefined |

27 | |

28 | main :: IO () |

29 | main = print "ok" |

30 | |

31 | |

32 | c:/ws/main/depot/QA/EDG/EDG_priv/FPF_Dev.br/src $ ghc -main-is GHCBug ~/GHCBug.hs |

33 | ghc.exe: panic! (the 'impossible' happened) |

34 | (GHC version 6.10.1 for i386-unknown-mingw32): |

35 | initC: srt_lbl |

36 | |

37 | Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug |

38 | |

39 | c:/ws/main/depot/QA/EDG/EDG_priv/FPF_Dev.br/src $ ghc -v -dcore-lint -main-is GHCBug ~/GHCBug.hs |

40 | Glasgow Haskell Compiler, Version 6.10.1, for Haskell 98, stage 2 booted by GHC version 6.8.3 |

41 | Using package config file: C:\ws\main\depot\QA\EDG\EDG_priv\FPF_Dev.br\ThirdParty\ghc\ghc-6.10.1\package.conf |

42 | hiding package base-3.0.3.0 to avoid conflict with later version base-4.0.0.0 |

43 | wired-in package ghc-prim mapped to ghc-prim-0.1.0.0 |

44 | wired-in package integer mapped to integer-0.1.0.0 |

45 | wired-in package base mapped to base-4.0.0.0 |

46 | wired-in package rts mapped to rts-1.0 |

47 | wired-in package haskell98 mapped to haskell98-1.0.1.0 |

48 | wired-in package syb mapped to syb-0.1.0.0 |

49 | wired-in package template-haskell mapped to template-haskell-2.3.0.0 |

50 | wired-in package dph-seq mapped to dph-seq-0.3 |

51 | wired-in package dph-par mapped to dph-par-0.3 |

52 | Hsc static flags: -static |

53 | Created temporary directory: C:\TEMP\/ghc4960_2 |

54 | *** Checking old interface for main:GHCBug: |

55 | *** Parser: |

56 | *** Renamer/typechecker: |

57 | *** Desugar: |

58 | Result size = 199 |

59 | *** Core Lint Errors: in result of Desugar *** |

60 | {-# LINE 21 "F:\ME\GHCBug.hs #-}: |

61 | [RHS of pvr_awa :: GHCBug.AssocSyn |

62 | GHC.Types.Double GHC.Types.Double] |

63 | pvr_afN is out of scope |

64 | *** Offending Program *** |

65 | Rec { |

66 | $dShow_axM :: GHC.Show.Show GHC.Types.Char |

67 | [] |

68 | $dShow_axM = GHC.Show.$f17 |

69 | $dShow_avR :: GHC.Show.Show [GHC.Types.Char] |

70 | [] |

71 | $dShow_avR = GHC.Show.$f20 @ GHC.Types.Char $dShow_axM |

72 | :Main.main :: GHC.IOBase.IO () |

73 | [Exported] |

74 | [] |

75 | :Main.main = GHC.TopHandler.runMainIO @ () GHCBug.main |

76 | GHCBug.$f2 :: GHCBug.Sub GHC.Types.Double |

77 | [Exported] |

78 | [] |

79 | GHCBug.$f2 = GHCBug.:DSub @ GHC.Types.Double |

80 | $dSub_axu :: GHCBug.Sub GHC.Types.Double |

81 | [] |

82 | $dSub_axu = GHCBug.$f2 |

83 | showList_axt :: forall a_afG. |

84 | (GHC.Show.Show a_afG) => |

85 | [GHCBug.PVR a_afG] -> GHC.Show.ShowS |

86 | [] |

87 | showList_axt = |

88 | \ (@ a_afG) ($dShow_awW :: GHC.Show.Show a_afG) -> |

89 | letrec { |

90 | showList_axm :: [GHCBug.PVR a_afG] -> GHC.Show.ShowS |

91 | [] |

92 | showList_axm = |

93 | GHC.Show.showList__ |

94 | @ (GHCBug.PVR a_afG) (showsPrec_axp (GHC.Types.I# 0)); |

95 | showsPrec_axp :: GHC.Types.Int |

96 | -> GHCBug.PVR a_afG |

97 | -> GHC.Show.ShowS |

98 | [] |

99 | showsPrec_axp = GHC.Show.showsPrec @ (GHCBug.PVR a_afG) $dShow_axq; |

100 | showList_axn :: [GHCBug.PVR a_afG] -> GHC.Show.ShowS |

101 | [] |

102 | showList_axn = showList_axm; |

103 | $dShow_axq :: GHC.Show.Show (GHCBug.PVR a_afG) |

104 | [] |

105 | $dShow_axq = $dShow_axl; |

106 | $dShow_axl :: GHC.Show.Show (GHCBug.PVR a_afG) |

107 | [] |

108 | $dShow_axl = GHCBug.$f4 @ a_afG $dShow_awW; } in |

109 | showList_axm |

110 | showsPrec_axh :: forall a_afG. |

111 | (GHC.Show.Show a_afG) => |

112 | GHC.Types.Int -> GHCBug.PVR a_afG -> GHC.Show.ShowS |

113 | [] |

114 | showsPrec_axh = |

115 | \ (@ a_afG) ($dShow_awW :: GHC.Show.Show a_afG) -> |

116 | letrec { |

117 | showsPrec_awZ :: GHC.Types.Int |

118 | -> GHCBug.PVR a_afG |

119 | -> GHC.Show.ShowS |

120 | [] |

121 | showsPrec_awZ = |

122 | \ (a_ajk :: GHC.Types.Int) (ds_dxT :: GHCBug.PVR a_afG) -> |

123 | case ds_dxT of wild_B1 { GHCBug.PVR b1_ajm -> |

124 | letrec { } in |

125 | GHC.Show.showParen |

126 | (>=_ax6 a_ajk (GHC.Types.I# 11)) |

127 | (GHC.Base.. |

128 | @ GHC.Base.String |

129 | @ GHC.Base.String |

130 | @ GHC.Base.String |

131 | (GHC.Show.showString (GHC.Base.unpackCString# "PVR ")) |

132 | (showsPrec_axd (GHC.Types.I# 11) b1_ajm)) |

133 | }; |

134 | showsPrec_axd :: GHC.Types.Int -> a_afG -> GHC.Show.ShowS |

135 | [] |

136 | showsPrec_axd = GHC.Show.showsPrec @ a_afG $dShow_axg; |

137 | $dOrd_axe :: GHC.Classes.Ord GHC.Types.Int |

138 | [] |

139 | $dOrd_axe = GHC.Base.$f1; |

140 | >=_ax6 :: GHC.Types.Int -> GHC.Types.Int -> GHC.Bool.Bool |

141 | [] |

142 | >=_ax6 = GHC.Classes.>= @ GHC.Types.Int $dOrd_axe; |

143 | showsPrec_ax1 :: GHC.Types.Int |

144 | -> GHCBug.PVR a_afG |

145 | -> GHC.Show.ShowS |

146 | [] |

147 | showsPrec_ax1 = showsPrec_awZ; |

148 | $dShow_axg :: GHC.Show.Show a_afG |

149 | [] |

150 | $dShow_axg = $dShow_awW; |

151 | $dShow_awY :: GHC.Show.Show (GHCBug.PVR a_afG) |

152 | [] |

153 | $dShow_awY = GHCBug.$f4 @ a_afG $dShow_awW; } in |

154 | showsPrec_awZ |

155 | GHCBug.$f4 :: forall a_afG. |

156 | (GHC.Show.Show a_afG) => |

157 | GHC.Show.Show (GHCBug.PVR a_afG) |

158 | [Exported] |

159 | [] |

160 | GHCBug.$f4 = |

161 | __inline_me (\ (@ a_afG) ($dShow_awW :: GHC.Show.Show a_afG) -> |

162 | letrec { |

163 | $dShow_awX :: GHC.Show.Show (GHCBug.PVR a_afG) |

164 | [] |

165 | $dShow_awX = |

166 | GHC.Show.:DShow |

167 | @ (GHCBug.PVR a_afG) |

168 | (showsPrec_axh @ a_afG $dShow_awW) |

169 | (GHC.Show.$dmshow @ (GHCBug.PVR a_afG) $dShow_awX) |

170 | (showList_axt @ a_afG $dShow_awW); } in |

171 | $dShow_awX) |

172 | /=_awV :: forall a_afG. |

173 | (GHC.Classes.Eq a_afG) => |

174 | GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

175 | [] |

176 | /=_awV = |

177 | \ (@ a_afG) ($dEq_awA :: GHC.Classes.Eq a_afG) -> |

178 | letrec { |

179 | /=_awO :: GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

180 | [] |

181 | /=_awO = |

182 | \ (a_ajg :: GHCBug.PVR a_afG) (b_aji :: GHCBug.PVR a_afG) -> |

183 | GHC.Classes.not (==_awR a_ajg b_aji); |

184 | ==_awR :: GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

185 | [] |

186 | ==_awR = GHC.Classes.== @ (GHCBug.PVR a_afG) $dEq_awS; |

187 | /=_awP :: GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

188 | [] |

189 | /=_awP = /=_awO; |

190 | $dEq_awS :: GHC.Classes.Eq (GHCBug.PVR a_afG) |

191 | [] |

192 | $dEq_awS = $dEq_awN; |

193 | $dEq_awN :: GHC.Classes.Eq (GHCBug.PVR a_afG) |

194 | [] |

195 | $dEq_awN = GHCBug.$f3 @ a_afG $dEq_awA; } in |

196 | /=_awO |

197 | ==_awM :: forall a_afG. |

198 | (GHC.Classes.Eq a_afG) => |

199 | GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

200 | [] |

201 | ==_awM = |

202 | \ (@ a_afG) ($dEq_awA :: GHC.Classes.Eq a_afG) -> |

203 | letrec { |

204 | ==_awD :: GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

205 | [] |

206 | ==_awD = |

207 | \ (ds_dxP :: GHCBug.PVR a_afG) (ds_dxQ :: GHCBug.PVR a_afG) -> |

208 | case ds_dxP of wild_B1 { GHCBug.PVR a1_ajc -> |

209 | letrec { } in |

210 | case ds_dxQ of wild_B1 { GHCBug.PVR b1_aje -> |

211 | letrec { } in ==_awK a1_ajc b1_aje |

212 | } |

213 | }; |

214 | ==_awK :: a_afG -> a_afG -> GHC.Bool.Bool |

215 | [] |

216 | ==_awK = GHC.Classes.== @ a_afG $dEq_awL; |

217 | ==_awI :: GHCBug.PVR a_afG -> GHCBug.PVR a_afG -> GHC.Bool.Bool |

218 | [] |

219 | ==_awI = ==_awD; |

220 | $dEq_awL :: GHC.Classes.Eq a_afG |

221 | [] |

222 | $dEq_awL = $dEq_awA; |

223 | $dEq_awC :: GHC.Classes.Eq (GHCBug.PVR a_afG) |

224 | [] |

225 | $dEq_awC = GHCBug.$f3 @ a_afG $dEq_awA; } in |

226 | ==_awD |

227 | GHCBug.$f3 :: forall a_afG. |

228 | (GHC.Classes.Eq a_afG) => |

229 | GHC.Classes.Eq (GHCBug.PVR a_afG) |

230 | [Exported] |

231 | [] |

232 | GHCBug.$f3 = |

233 | __inline_me (\ (@ a_afG) ($dEq_awA :: GHC.Classes.Eq a_afG) -> |

234 | letrec { |

235 | $dEq_awB :: GHC.Classes.Eq (GHCBug.PVR a_afG) |

236 | [] |

237 | $dEq_awB = |

238 | GHC.Classes.:DEq |

239 | @ (GHCBug.PVR a_afG) |

240 | (==_awM @ a_afG $dEq_awA) |

241 | (/=_awV @ a_afG $dEq_awA); } in |

242 | $dEq_awB) |

243 | GHCBug.analyseCore :: forall a_afL. |

244 | GHCBug.Core a_afL -> GHCBug.AssocSyn a_afL a_afL |

245 | [Exported] |

246 | [] |

247 | GHCBug.analyseCore = |

248 | \ (@ a_avV) -> |

249 | let { |

250 | analyseCore_avW :: GHCBug.Core a_avV -> GHCBug.AssocSyn a_avV a_avV |

251 | [] |

252 | analyseCore_avW = GHCBug.analyseCore @ a_avV } in |

253 | \ (ds_dxN :: GHCBug.Core a_avV) -> |

254 | case ds_dxN of wild_B1 { GHCBug.Ctr @ $co$_awb -> |

255 | letrec { |

256 | pvr_awa :: GHCBug.AssocSyn GHC.Types.Double GHC.Types.Double |

257 | [] |

258 | pvr_awa = |

259 | pvr_afN @ GHC.Types.Double @ (sym GHCBug.:CoF:R1AssocSyn); } in |

260 | letrec { |

261 | pvr_afN :: forall a_afP. |

262 | (GHCBug.PVR ~ GHCBug.AssocSyn a_afP) => |

263 | GHCBug.AssocSyn a_afP a_afP |

264 | [] |

265 | pvr_afN = |

266 | \ (@ a_avY) (@ $coPVR_aw5) -> |

267 | letrec { |

268 | pvr_avZ :: GHCBug.AssocSyn a_avY a_avY |

269 | [] |

270 | pvr_avZ = GHC.Err.undefined @ (GHCBug.AssocSyn a_avY a_avY); } in |

271 | pvr_avZ; } in |

272 | pvr_awa |

273 | `cast` (trans |

274 | (trans |

275 | (trans |

276 | (GHCBug.AssocSyn GHC.Types.Double) |

277 | (trans |

278 | (GHCBug.AssocSyn (trans GHC.Types.Double (sym $co$_awb))) |

279 | (trans |

280 | (GHCBug.AssocSyn $co$_awb) |

281 | (trans |

282 | GHCBug.:CoF:R1AssocSyn |

283 | (sym (trans (trans GHCBug.PVR GHCBug.PVR) GHCBug.PVR))))) |

284 | GHC.Types.Double) |

285 | (sym |

286 | (trans |

287 | GHCBug.PVR |

288 | (sym |

289 | (trans |

290 | (trans GHCBug.PVR (trans GHCBug.PVR GHCBug.PVR)) GHCBug.PVR))) |

291 | (trans GHC.Types.Double (sym $co$_awb)))) |

292 | (sym |

293 | (trans |

294 | (GHCBug.AssocSyn a_avV) |

295 | (trans |

296 | (GHCBug.AssocSyn $co$_awb) |

297 | (trans |

298 | GHCBug.:CoF:R1AssocSyn |

299 | (sym (trans (trans GHCBug.PVR GHCBug.PVR) GHCBug.PVR)))) |

300 | a_avV)) |

301 | :: GHCBug.AssocSyn GHC.Types.Double GHC.Types.Double |

302 | ~ |

303 | GHCBug.AssocSyn a_avV a_avV) |

304 | } |

305 | GHCBug.main :: GHC.IOBase.IO () |

306 | [] |

307 | GHCBug.main = print_avQ (GHC.Base.unpackCString# "ok") |

308 | print_avQ :: [GHC.Types.Char] -> GHC.IOBase.IO () |

309 | [] |

310 | print_avQ = System.IO.print @ [GHC.Types.Char] $dShow_avR |

311 | main_av1 :: GHC.IOBase.IO () |

312 | [] |

313 | main_av1 = GHCBug.main |

314 | end Rec } |

315 | |

316 | *** End of Offense *** |

317 | |

318 | |

319 | <no location info>: |

320 | Compilation had errors |

321 | |

322 | |

323 | *** Deleting temp files: |

324 | Deleting: C:\TEMP\/ghc4960_2/ghc4960_0.s |

325 | Warning: deleting non-existent C:\TEMP\/ghc4960_2/ghc4960_0.s |

326 | *** Deleting temp dirs: |

327 | Deleting: C:\TEMP\/ghc4960_2 |

328 | c:/ws/main/depot/QA/EDG/EDG_priv/FPF_Dev.br/src $ |