Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow constructor calls with generics #458

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

JSAbrahams
Copy link
Owner

Relevant issues

Summary

Only issue now is that we must mark generics when
checking class bodies.
This means that we should check whether they exist in the context, but instead whether they are
mentioned as a generic in the class name.

The two new tests hint as this, but within this PR the generate stage should also preserve the
generics of classes in the output.

Added Tests

JSAbrahams and others added 3 commits January 22, 2023 22:13
* Classes inherit all from parent

- Remove INIT token
- in uses __contains__ magic method
- Remove Mamba specific magic methods

* Filter out parent fields in assign check
* Check assigned to in if and match branches

* Use intersection in if branches
In certain contexts.
Also substitute generics in function calls, which
includes constructors.

Only issue now is that we must mark generics when
checking class bodies.
This means that we should check whether they exist
in the context, but instead whether they are
mentioned as a generic in the class name.

The two new tests hint as this, but within this PR
the generate stage should also preserve the
generics of classes in the output.
@JSAbrahams JSAbrahams added enhancement: check New feature in the type check module enhancement: parse New feature in the parse module labels Feb 4, 2023
@JSAbrahams JSAbrahams added this to the v0.3.7 | Type alias milestone Feb 4, 2023
@JSAbrahams JSAbrahams self-assigned this Feb 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement: check New feature in the type check module enhancement: parse New feature in the parse module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant