<div dir="ltr"><div>I've investigated a bit more. You are right `typeHasFixedRuntimeRep` works fine, the panic was caused by querying the representation type of `LitRubbish` type argument. In some cases `getRuntimeRep` causes GHC panic for `LitRubbish` type arguments.<br></div><div>I did solve the issue with special casing the LitRubbish type argument handling by using only the `runtimeRepPrimRep` function. In the general case I tested the type with `isUnboxedTupleType` and `isUnboxedSumType` which rely on `getRuntimeRep`.<br></div><div>Thanks for the tips and feedback.</div><div>Regards,</div><div>Csaba<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 14, 2022 at 6:44 PM Sam Derbyshire <<a href="mailto:sam.derbyshire@gmail.com">sam.derbyshire@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hmm, that's strange, both isTypeLevPoly and typeHasFixedRuntimeRep have the same precondition: the kind of the type is of the form TYPE rep. So they should panic in the same circumstances. Can you give a bit more information? What panics are you running into?<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 14 Sept 2022 at 18:40, Csaba Hruska <<a href="mailto:csaba.hruska@gmail.com" target="_blank">csaba.hruska@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span style="font-size:12.8px">Hi,</span><div dir="auto" style="font-size:12.8px">Thanks for the tip, I've tried it and it behaves differently than isTypeLevPoly. I can get panic when querying the reptype for fixed reptypes. That means isTypeLevPoly semantically is not the same as the negated result of <span style="font-family:monospace">typeHasFixedRuntimeRep.</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 14 Sep 2022, 18:19 Sam Derbyshire, <<a href="mailto:sam.derbyshire@gmail.com" target="_blank">sam.derbyshire@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Csaba,</div><div><br></div><div>I think you want the function <span style="font-family:monospace">typeHasFixedRuntimeRep</span> from <span style="font-family:monospace">GHC.Core.Type</span>.</div><div><br></div><div>Best,</div><div><br></div><div>Sam<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 14 Sept 2022 at 18:12, Csaba Hruska <<a href="mailto:csaba.hruska@gmail.com" rel="noreferrer" target="_blank">csaba.hruska@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello GHC Devs,</div><div><br></div><div>I've noticed that the `isTypeLevPoly` function has been removed from GHC since 9.4.</div><div>I used it to decide the validity of querying the representation type of every value in the STG IR.</div><div>It was mandatory to prevent GHC panics, because there are a lot of partial functions in GHC.</div><div>Is there an alternative to `isTypeLevPoly` in GHC 9.4?</div><div><br></div><div>Best regards,</div><div>Csaba Hruska<br></div></div>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" rel="noreferrer" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>