-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Labels
bidirectional inferenceInference of types that takes into account the context of a declared type or expected typeInference of types that takes into account the context of a declared type or expected typegenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Description
Summary
def f1() -> list[object]:
return [1, 2, 3] # lovely, bidirectional type inference uses the return type to infer `list[object]`
def f2() -> list[object]:
result = [1, 2, 3]
return result # error: bi-directional type inference does not look ahead, so the inferred type is `list[int]`
Version
No response
Metadata
Metadata
Assignees
Labels
bidirectional inferenceInference of types that takes into account the context of a declared type or expected typeInference of types that takes into account the context of a declared type or expected typegenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation