-
Notifications
You must be signed in to change notification settings - Fork 4
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
Context builder does not recognize field inits in python constructors #311
Labels
bug: check
Something in the type check module isn't working (as intended)
Milestone
Comments
JSAbrahams
added
the
bug: check
Something in the type check module isn't working (as intended)
label
May 27, 2022
This was referenced May 27, 2022
JSAbrahams
added a commit
that referenced
this issue
May 28, 2022
* Don't include Python init in GenericClassDef - Made note of #311 * Don't include Python init in GenericClassDef - Made note of #314 - Made note of #315 - Made note of #316 - Made note of #317 - Made note of #318 * Check that typed assign with expr does have type - Made note of #319 * Test functionality of class from AST - Type definition (and aliases) have self argument - Make self in class have class as type - Remove args from GenericParent, it doesn't do anything. - Function arguments from python source is mutable. The application logic in class from AST is currently very convoluted. Could use a rewrite. * Test that py and mamba class can have generics TrueName now takes generic arguments from type. Now context also stores class generics from Mamba classes. It may very well be that this explains some weird behaviour we had around generics (in that they didn't work in most cases). In a future release we should test this further since I'm sure there are some cases we've missed. - Made note of #320 * Add optional to Name in generate Always print out generics in alphabetical order. This ensures that the output is easy to predict, we are not dependent on the whims of the iterator over the set, possibly preventing flaky tests. Make annotating output the default in tests as well. As we start to implement new features and debug the checking stage we should then automatically see old tests failing as well. * Make sorting of generics case-insensitive Add new description to README * Verify current unknown generic parent behaviour Currently, no check is done that a parent generic exists until the class is actually used. Perhaps in future this behaviour should be changed, however.
JSAbrahams
added a commit
that referenced
this issue
Jun 7, 2022
* Don't include Python init in GenericClassDef - Made note of #311 * Don't include Python init in GenericClassDef - Made note of #314 - Made note of #315 - Made note of #316 - Made note of #317 - Made note of #318 * Check that typed assign with expr does have type - Made note of #319 * Test functionality of class from AST - Type definition (and aliases) have self argument - Make self in class have class as type - Remove args from GenericParent, it doesn't do anything. - Function arguments from python source is mutable. The application logic in class from AST is currently very convoluted. Could use a rewrite. * Test that py and mamba class can have generics TrueName now takes generic arguments from type. Now context also stores class generics from Mamba classes. It may very well be that this explains some weird behaviour we had around generics (in that they didn't work in most cases). In a future release we should test this further since I'm sure there are some cases we've missed. - Made note of #320 * Add optional to Name in generate Always print out generics in alphabetical order. This ensures that the output is easy to predict, we are not dependent on the whims of the iterator over the set, possibly preventing flaky tests. Make annotating output the default in tests as well. As we start to implement new features and debug the checking stage we should then automatically see old tests failing as well. * Make sorting of generics case-insensitive Add new description to README * Verify current unknown generic parent behaviour Currently, no check is done that a parent generic exists until the class is actually used. Perhaps in future this behaviour should be changed, however.
JSAbrahams
added a commit
that referenced
this issue
Jun 7, 2022
* Don't include Python init in GenericClassDef - Made note of #311 * Don't include Python init in GenericClassDef - Made note of #314 - Made note of #315 - Made note of #316 - Made note of #317 - Made note of #318 * Check that typed assign with expr does have type - Made note of #319 * Test functionality of class from AST - Type definition (and aliases) have self argument - Make self in class have class as type - Remove args from GenericParent, it doesn't do anything. - Function arguments from python source is mutable. The application logic in class from AST is currently very convoluted. Could use a rewrite. * Test that py and mamba class can have generics TrueName now takes generic arguments from type. Now context also stores class generics from Mamba classes. It may very well be that this explains some weird behaviour we had around generics (in that they didn't work in most cases). In a future release we should test this further since I'm sure there are some cases we've missed. - Made note of #320 * Add optional to Name in generate Always print out generics in alphabetical order. This ensures that the output is easy to predict, we are not dependent on the whims of the iterator over the set, possibly preventing flaky tests. Make annotating output the default in tests as well. As we start to implement new features and debug the checking stage we should then automatically see old tests failing as well. * Make sorting of generics case-insensitive Add new description to README * Verify current unknown generic parent behaviour Currently, no check is done that a parent generic exists until the class is actually used. Perhaps in future this behaviour should be changed, however.
JSAbrahams
added a commit
that referenced
this issue
Jun 8, 2022
* Don't include Python init in GenericClassDef - Made note of #311 * Don't include Python init in GenericClassDef - Made note of #314 - Made note of #315 - Made note of #316 - Made note of #317 - Made note of #318 * Check that typed assign with expr does have type - Made note of #319 * Test functionality of class from AST - Type definition (and aliases) have self argument - Make self in class have class as type - Remove args from GenericParent, it doesn't do anything. - Function arguments from python source is mutable. The application logic in class from AST is currently very convoluted. Could use a rewrite. * Test that py and mamba class can have generics TrueName now takes generic arguments from type. Now context also stores class generics from Mamba classes. It may very well be that this explains some weird behaviour we had around generics (in that they didn't work in most cases). In a future release we should test this further since I'm sure there are some cases we've missed. - Made note of #320 * Add optional to Name in generate Always print out generics in alphabetical order. This ensures that the output is easy to predict, we are not dependent on the whims of the iterator over the set, possibly preventing flaky tests. Make annotating output the default in tests as well. As we start to implement new features and debug the checking stage we should then automatically see old tests failing as well. * Make sorting of generics case-insensitive Add new description to README * Verify current unknown generic parent behaviour Currently, no check is done that a parent generic exists until the class is actually used. Perhaps in future this behaviour should be changed, however.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of Bug
Context builder does not recognize field inits in python constructors.
How to Reproduce
Build context from following class written in Python:
Expected behavior
It should produce a context with
MyClass
which has one fielda: Int
.However, the class has no such field.
Additional context
We should traverse the constructor and make not of all assignments to self.
The text was updated successfully, but these errors were encountered: