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

Specification: Assignment clarification #34458

Open
eernstg opened this Issue Sep 13, 2018 · 0 comments

Comments

1 participant
@eernstg
Member

eernstg commented Sep 13, 2018

In dartLangSpec.tex, section 'Assignment', it is specified for v = e that we consider the innermost declaration D whose name is v or v=, and that 'it is a compile-time error if the static type of e may not be assigned to the static type of v'; but if D is a setter it makes no sense to talk about 'the static type of v', it would have to be the declared type of its formal parameter. So the current spec needs some fixes, and many of the fixes in this section have been made in CL 51323.

However, the wording in 51323 still needs to be adjusted: (1) We must still talk about "the innermost declaration named v or v=, if it exists" in order to preserve the semantics ("keeping getters and setters together as a pair"), and (2) we must name the chosen declaration (call it d), and (3) we must refer to d at each step, considering all kinds that it could have.

For instance, we specify that 'It is a compile-time error if d denotes a prefix object, type declaration, or function declaration', but that should be in the static analysis part, and it is currently in the dynamic semantics part. In the dynamic semantics, we should just say that "ignore: it's an error, won't run".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment