diff --git a/mypyc/irbuild/prepare.py b/mypyc/irbuild/prepare.py index 2399647374c07..d42e35561d06f 100644 --- a/mypyc/irbuild/prepare.py +++ b/mypyc/irbuild/prepare.py @@ -301,7 +301,11 @@ def prepare_class_def( # Set up the parent class bases = [mapper.type_to_ir[base.type] for base in info.bases if base.type in mapper.type_to_ir] if not all(c.is_trait for c in bases[1:]): - errors.error("Non-trait bases must appear first in parent list", path, cdef.line) + errors.error( + "Multiple inheritance is not currently supported (except for traits)", + path, + cdef.line, + ) ir.traits = [c for c in bases if c.is_trait] mro = [] diff --git a/mypyc/test-data/commandline.test b/mypyc/test-data/commandline.test index 6612df9e18861..9a081fbfdaa60 100644 --- a/mypyc/test-data/commandline.test +++ b/mypyc/test-data/commandline.test @@ -164,7 +164,7 @@ class Trait2(Concrete2): class NonExt(Concrete1): # E: Non-extension classes may not inherit from extension classes pass -class Nope(Trait1, Concrete2): # E: Non-trait bases must appear first in parent list # E: Non-trait MRO must be linear +class Nope(Trait1, Concrete2): # E: Multiple inheritance is not currently supported (except for traits) # E: Non-trait MRO must be linear pass @decorator