Describe the Bug
Minimal case
class Field[I, M]:
pass
class Base[I](Field[list[I] | I, I]): # scapy.fields._EnumField
pass
class Mid[MidI](Base[MidI]): # scapy.fields.EnumField
pass
class Left(Mid[int]): # scapy.fields.BytesEnumField
pass
class Mixin[I](Mid[I]):
pass
class Combined(Mixin[int], Left): # ERROR Class `Combined` has inconsistent type arguments for base class `Field`: `Field[list[int] | int, int]` and `Field[int | list[int], int]` [invalid-inheritance]
pass
Expected output
No error. Both branches bottom out in the same substitution Base[int] → Field[list[int] | int, int].
Key observations
Flip the declared union order to Field[I | list[I], I] → the reported pair stays list[int] | int vs int | list[int]. The ordering is produced by resolution, not read from source.
Sandbox Link
https://pyrefly.org/sandbox/?project=v2.hVXLboMwEPwVq1zoofjOMVUrIbVVLz0RVDnBSVYqdoRNBar67xmv8xAJSQ5IgHZnzDIzey0yo1Veg7PLAtFQjYZ2MtNMOV0WVRor2W1FBa2ip6gec5EIt1TbIeOMcNn3i-karp2Ge6e6xAVABubbS5Q7IG965dOABDlMdM8GzObuOXoy4bsCTDjCdNmzbRZkdI2yUB_4sB1AD1bQkoF5qH4is8EyYa-N9NN5-nFx3on4wgP54Wh_JuI8sG2jsAq6ZqHbtM8BG7MEfj2INFp1NX_44Kpc_PX_e5mciTQRn_GF2P9vxDPUve6wBMCazU2C_Ndi4_3W5VIe2m27ltrI2i6dHHXIcEChfhXxahnDCcumcoC94Y6bCt0B
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
Minimal case
Expected output
No error. Both branches bottom out in the same substitution
Base[int]→Field[list[int] | int, int].Key observations
Flip the declared union order to
Field[I | list[I], I]→ the reported pair stayslist[int] | intvsint | list[int]. The ordering is produced by resolution, not read from source.Sandbox Link
https://pyrefly.org/sandbox/?project=v2.hVXLboMwEPwVq1zoofjOMVUrIbVVLz0RVDnBSVYqdoRNBar67xmv8xAJSQ5IgHZnzDIzey0yo1Veg7PLAtFQjYZ2MtNMOV0WVRor2W1FBa2ip6gec5EIt1TbIeOMcNn3i-karp2Ge6e6xAVABubbS5Q7IG965dOABDlMdM8GzObuOXoy4bsCTDjCdNmzbRZkdI2yUB_4sB1AD1bQkoF5qH4is8EyYa-N9NN5-nFx3on4wgP54Wh_JuI8sG2jsAq6ZqHbtM8BG7MEfj2INFp1NX_44Kpc_PX_e5mciTQRn_GF2P9vxDPUve6wBMCazU2C_Ndi4_3W5VIe2m27ltrI2i6dHHXIcEChfhXxahnDCcumcoC94Y6bCt0B
(Only applicable for extension issues) IDE Information
No response