Skip to content

Conversation

@mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Feb 1, 2020

Add support for @Unsafe annotation as isUnsafe and hasUnsafe.

See: #40429 for the definition of the annotation.

@mehmetf mehmetf requested a review from pq February 1, 2020 00:05
/// The name of the top-level variable used to mark a class as being sealed.
static const String _SEALED_VARIABLE_NAME = "sealed";

/// The name of the top-level variable used to mark a method as unsafe.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just methods or other members?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Unsafe is a class, not a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -1,3 +1,6 @@
## 0.39.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be 0.39.5?

/cc @stereotype441

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I am not sure what -dev means....

Copy link
Member

@bwilkerson bwilkerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We obviously need to resolve the question of where the annotation lives before committing this.

/// The name of the top-level variable used to mark a class as being sealed.
static const String _SEALED_VARIABLE_NAME = "sealed";

/// The name of the top-level variable used to mark a method as unsafe.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Unsafe is a class, not a variable.


@override
bool get isUnsafe =>
element is PropertyAccessorElement &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong to me. I would have expected that it would be a ClassElement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: I don't know what I am doing :-) So thanks for all the help!

I have not setup my environment to test this yet. When the annotation is agreed upon and pushed to master, I can tinker with this.

@mehmetf
Copy link
Contributor Author

mehmetf commented Feb 17, 2020

Closing this PR as there's a better proposal being discussed.

@mehmetf mehmetf closed this Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants