Skip to content

Type aliases are not fully qualified in type mismatch errors #2606

@missingdays

Description

@missingdays

Summary

In this example

class A:
        class B[T]:
            pass

        type D = list

class C:
        class B[T]:
            pass

        type D = list

def f(b: C.B[C.D]):
    a: A.B[A.D] = b

the error reported is "Object of type main.C.B[D] is not assignable to main.A.B[D]"

Note how D is not fully qualified, even though the D on the left hand side is different from D on the right hand side.

Version

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdiagnosticsRelated to reporting of diagnostics.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions