-
Notifications
You must be signed in to change notification settings - Fork 1k
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
SimType & friends: Fully typecheck, fix observed bugs #4610
base: master
Are you sure you want to change the base?
Conversation
What do you think of using |
Done |
not isinstance(base_type, SimTypeBottom) | ||
and not isinstance(data_type, SimTypeBottom) | ||
and base_type.size < data_type.size | ||
base_type.size is not None and data_type.size is not None and base_type.size < data_type.size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new way of testing if something is a bottom type .size is None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a superset of that check. This code will fail on any unsizable type so that's what I'm checking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are all the types that can be unsized? SimTypeBottom
and SimStruct
s without an arch specified?
By the way I find the (name of the) |
for some inconceivable reason, some of the numeric types allow parametrizing themselves with size=None, and there are in fact cases to handle this strewn about the simtype code, so I can only assume this is actually used. |
This involved making several classes NOT subclasses of other classes, since doing so would violate the Liskov Substitution Principle. Several bugs were discovered while making these changes, they were all fixed.
Type-checking was done with pyright.