-
Notifications
You must be signed in to change notification settings - Fork 789
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 ILTypeDef super type calculation lazy #18005
Conversation
❗ Release notes required
|
05e897a
to
d08555d
Compare
6774589
to
0416fe7
Compare
732ecc4
to
1a886f5
Compare
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.
The deletion of ILTypeDefKind caused quite change to the compilerservice surface area. I presume compilerservice customers won't feel the pain to badly. I wonder if we should consider locking it down to no breaking changes. However, that is probably a discussion for another time.
@KevinRansom Thanks for bringing this up, it's indeed important that we make things easier to FCS users. As it has been over the last few years, usually the changes improve things enough to justify the costs of updating things 🙂 AFAIK, the only FCS client that currently works with these IL types directly is Rider, and this change improves the things for us, so we're happy to update the changed types usages. |
By analogy with issues from previous PRs (#17392, #16168) which added ways to pass lazy calculation of custom attributes and interfaces,
ILTypeDef
constructor (public API) lacks the ability to pass lazy computation of a base type. Right now, it is necessary to read the base type when creatingILTypeDef
only to calculateILTypeDefKind
using the name of the base type, which seems redundant.Therefore, this PR proposes:
ILTypeDef
constructorILTypeDefKind
using lightweight base type name lookup without fully reading base typeILTypeDef
that does not require lazy evaluation and automatically evaluatesILTypeDefKind
ILTypeDefKind
withILTypeDefAdditionalFlags
into a single enum (in future prs, I will try to combine it with TypeAttributes and get rid of another redundant field inILTypeDef
)Changes from this PR also show a slight performance increase in benchmarks (similar analysis of the ReSharper.FSharp.Psi.Services project as in previous PRs), although this is not the main reason for creating this PR