-
Notifications
You must be signed in to change notification settings - Fork 380
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
TY: convert primitive types from object to class #7503
Conversation
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.
LGTM.
The one thing I'd made additionally is turning name
and ordinal
fields in TyInteger
and TyFloat
classes into abstract properties with getters overridden in descendant classes.
Which will probably introduce all kinds of scary breakage and problems (especially the description of this PR #4243 scares me in relation to comparing types
Well, ==
just shouldn't be used for Ty
s. But there are already quite lot of such usages and I have no idea how to find them
I didn't change TyNever and TyUnknown, because we probably don't need aliases to work for them (?).
Most likely yes.
a48ee79
to
cc28619
Compare
Good idea, I changed them. EDIT: Oh, I thought that |
cc28619
to
08205f5
Compare
Now all primitive types implement these properties with getters and there should be no memory wasted on backing fields. |
bors r=vlad20012 |
7503: TY: convert primitive types from object to class r=vlad20012 a=Kobzol This is a naive attempt to reduce the usage of `object` in primitive types and convert them to standard classes instead. This is probably needed as a first step to solve #5080. I didn't change `TyNever` and `TyUnknown`, because we probably don't need aliases to work for them (?). The ultimate plan is to move `aliasedBy` from `TyAdt` to `Ty`. Which will probably introduce all kinds of scary breakage and problems (especially the description of this PR #4243 scares me in relation to comparing types :D ). Sending PR to see what kinds of tests fail. Co-authored-by: Jakub Beránek <berykubik@gmail.com>
Build failed: |
bors retry |
7503: TY: convert primitive types from object to class r=vlad20012 a=Kobzol This is a naive attempt to reduce the usage of `object` in primitive types and convert them to standard classes instead. This is probably needed as a first step to solve #5080. I didn't change `TyNever` and `TyUnknown`, because we probably don't need aliases to work for them (?). The ultimate plan is to move `aliasedBy` from `TyAdt` to `Ty`. Which will probably introduce all kinds of scary breakage and problems (especially the description of this PR #4243 scares me in relation to comparing types :D ). Sending PR to see what kinds of tests fail. Co-authored-by: Jakub Beránek <berykubik@gmail.com>
Build failed: |
bors retry |
7503: TY: convert primitive types from object to class r=vlad20012 a=Kobzol This is a naive attempt to reduce the usage of `object` in primitive types and convert them to standard classes instead. This is probably needed as a first step to solve #5080. I didn't change `TyNever` and `TyUnknown`, because we probably don't need aliases to work for them (?). The ultimate plan is to move `aliasedBy` from `TyAdt` to `Ty`. Which will probably introduce all kinds of scary breakage and problems (especially the description of this PR #4243 scares me in relation to comparing types :D ). Sending PR to see what kinds of tests fail. Co-authored-by: Jakub Beránek <berykubik@gmail.com>
Build failed: |
bors retry |
Merge conflict. |
08205f5
to
92bc5cf
Compare
bors r=vlad20012 |
Build succeeded: |
This is a naive attempt to reduce the usage of
object
in primitive types and convert them to standard classes instead. This is probably needed as a first step to solve #5080. I didn't changeTyNever
andTyUnknown
, because we probably don't need aliases to work for them (?).The ultimate plan is to move
aliasedBy
fromTyAdt
toTy
. Which will probably introduce all kinds of scary breakage and problems (especially the description of this PR #4243 scares me in relation to comparing types :D ).Sending PR to see what kinds of tests fail.