Class fields type inference fails in inheritance scenarios in Codon 0.19
Open
bug
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 603
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 6
Description
In inheritance scenarios, the automatic inference function for class fields in Codon 0.19 fails.
```
class A:
def __init__(self, a: int):
self._a: int = a
class B(A):
def __init__(self, a: int, b: int):
super().__init__(a)
self._b: int = b
def add(self) -> int:
return self._a + self._b
print(B(1, 2).add())
```
An error occurs when the above code is executed. “error: 'A[NoneType]' does not match expected type 'A[int]'”
Contributor guide
Assessment
This issue has not been assessed yet.