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

Jadeite 3.0.91.2+Rowan1: does not handle constraints correctly when removing instance variables from classes #1011

Open
LisaAlmarode opened this issue Oct 16, 2024 · 0 comments

Comments

@LisaAlmarode
Copy link
Member

This configuration has much better constraint support than base 3.6.2. But does not seem to have been well tested for modifying classes that have constraints.

A class's constraints instance variable includes a set of constraints for all instance variables and all inherited instance variables. If a constraint is not explicitly set, the constraint is set to Object. So the number of constraints = number of ivars.

The browser, however, only prints the constraints: part of the definition if the constraint is not object. So if you recompile a class definition, you have no way to know all the constraints you have.

But even if you did know, it doesn't matter if you are removing an instance variable, since _installConstraints applies the old class version's constraints to the new class, and errors since there are fewer ivars than constraints.

This issue recorded for tracking, but customer is OK with using _clearConstraints as a workaround.

My code to get classes with constraints:

Object rwSubclass: 'Molly'
	instVarNames: #( aaa bbb)
	classVars: #()
	classInstVars: #()
	poolDictionaries: #()
	category: 'STON-Tests'
	options: #()

Molly rwSubclass: 'Ken'
	instVarNames: #( ccc ddd eee)
	classVars: #()
	classInstVars: #()
	poolDictionaries: #()
	category: 'STON-Tests'
	options: #()

Molly _installConstraints: {{ 'aaa' . String} . { 'bbb' . Integer} }.
Ken _installConstraints: {{ 'ccc' . Integer} . { 'ddd' . Integer} }. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant