[ty] Spell out "method resolution order" in unsupported-base subdiagnostic (#22194)

This commit is contained in:
Simon Lamon
2025-12-25 11:26:44 +01:00
committed by GitHub
parent 12f5ea51e3
commit dd3a985109
3 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ warning[unsupported-base]: Unsupported class base
18 |
19 | reveal_mro(Foo) # revealed: (<class 'Foo'>, Unknown, <class 'object'>)
|
info: ty cannot resolve a consistent MRO for class `Foo` due to this base
info: ty cannot resolve a consistent method resolution order (MRO) for class `Foo` due to this base
info: Only class objects or `Any` are supported as class bases
info: rule `unsupported-base` is enabled by default
@@ -68,7 +68,7 @@ warning[unsupported-base]: Unsupported class base
27 | class D(C): ... # error: [unsupported-base]
| ^ Has type `<class 'mdtest_snippet.<locals of function 'f'>.C @ src/mdtest_snippet.py:23'> | <class 'mdtest_snippet.<locals of function 'f'>.C @ src/mdtest_snippet.py:25'>`
|
info: ty cannot resolve a consistent MRO for class `D` due to this base
info: ty cannot resolve a consistent method resolution order (MRO) for class `D` due to this base
info: Only class objects or `Any` are supported as class bases
info: rule `unsupported-base` is enabled by default

View File

@@ -57,7 +57,7 @@ warning[unsupported-base]: Unsupported class base
7 | class Bad1:
8 | def __mro_entries__(self, bases, extra_arg):
|
info: ty cannot resolve a consistent MRO for class `Bar` due to this base
info: ty cannot resolve a consistent method resolution order (MRO) for class `Bar` due to this base
info: Only class objects or `Any` are supported as class bases
info: rule `unsupported-base` is enabled by default

View File

@@ -3532,7 +3532,7 @@ fn report_unsupported_base(
base_type.display(db)
));
diagnostic.info(format_args!(
"ty cannot resolve a consistent MRO for class `{}` due to this base",
"ty cannot resolve a consistent method resolution order (MRO) for class `{}` due to this base",
class.name(db)
));
diagnostic.info("Only class objects or `Any` are supported as class bases");