Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make sure types.Type instances are not mutated #7614

Open
sklam opened this issue Dec 2, 2021 · 2 comments
Open

Make sure types.Type instances are not mutated #7614

sklam opened this issue Dec 2, 2021 · 2 comments
Labels
good second issue A good issue for second time contributors Task

Comments

@sklam
Copy link
Member

sklam commented Dec 2, 2021

it's because the type instance was mutated directly and the name of the type would not reflect this. Am happy to merge this patch as is, but for the future, perhaps it'd make sense to create a task for making types immutable to prevent this sort of accident from reoccurring?

Originally posted by @stuartarchibald in #7610 (review)

Todos:

  • Use @property for attribute of Type instances.
@sklam sklam added good second issue A good issue for second time contributors Task labels Dec 2, 2021
@ehsantn
Copy link
Collaborator

ehsantn commented Dec 2, 2021

This has bitten us quite a few times too :) Very hard to debug.

@sklam sklam closed this as completed Dec 6, 2021
@sklam sklam reopened this Dec 6, 2021
@MiloniAtal
Copy link
Contributor

The Type Class already has @Property for attributes. To fix this do we need to check all the subclasses and see if they have immutable attributes i.e using the @Property decorator? Or is there anything else that needs to be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good second issue A good issue for second time contributors Task
Projects
Status: Timeboxed Issue tasks upto 4 hours
Development

No branches or pull requests

3 participants