Is this an inconsistency or intended?

Related: Decl literals and packed struct equality - #9 by gwenzek

It’s because == does Peer Type Resolution (PTR), which doesn’t resolve decl literals the same way an assignment or in fact switches would. Since default is a declaration and not an actual value of the enum, PTR is currently unable to resolve it. I think it’s an inconsistency, but don’t yet know of a concrete plan to resolve this (which isn’t to say there isn’t one).

4 Likes