Skip to content

Don't use 'Element.type'. #2028

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

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

scheglov
Copy link
Contributor

For most elements .type should be considered deprecated.

Specifically, for ClassElement, GenericFunctionTypeElement, and TypeParameterElement.
These elements don't have external types per se, but can be used to construct a type.
Before NNBD to construct a type from them you needed to provide type arguments.
Now you need to provide type arguments, and also the nullability suffix.

I have never been fond of using raw InterfaceType(s) as workpieces for actual types.
But with NNBD this just gets out of hand, especially with type parameters.
So, it is time for a clean-up.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Sep 23, 2019
@scheglov scheglov requested a review from keertip September 23, 2019 21:53
@scheglov scheglov force-pushed the dont-use-Element-dot-type branch from dacd797 to 8b77047 Compare September 26, 2019 01:14
@scheglov scheglov merged commit 729d946 into dart-lang:master Sep 30, 2019
@scheglov scheglov deleted the dont-use-Element-dot-type branch September 30, 2019 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants