Closed
Description
🚀 Feature
Now that we have explicit type aliases, would it be possible to use explicit TypeAlias names rather than expanded types in error messages? Maybe by keeping track of the aliases used in the definition of a type annotation, and using those aliases in error messages?
Pitch
An error message like this:
cmm/model/iterate.py:202: error: Incompatible types in assignment (expression has type "Union[Any, PyTreeLike, Tuple[Any, ...], List[Any], Dict[Hashable, Any], None]", variable has type "RecordedEncodingConfiguration")
cmm/problem/pooling.py:111: error: "Dict[str, Union[Any, PyTreeLike, Tuple[Any, ...], List[Any], Dict[Hashable, Any], None]]" has no attribute "prediction_map"
Would be much easier to read like this:
cmm/model/iterate.py:202: error: Incompatible types in assignment (expression has type "PyTree", variable has type "RecordedEncodingConfiguration")
cmm/problem/pooling.py:111: error: "Dict[str, PyTree]" has no attribute "prediction_map"