Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1811)

Issue 1465473002: Expand the definition of potentially constant expression. (Closed)

Created:
5 years, 1 month ago by Lasse Reichstein Nielsen
Modified:
4 years, 11 months ago
Reviewers:
eernst, gbracha
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Expand the definition of potentially constant expression. The current definition requires the expression to be valid and compile-time constant if constructor parameters are considered compile-time constants with types appropriate for their context. This is necessary but not sufficient, so this CL adds the further requirement that the expression must also be a valid (not necessarily constant) expession if the parameters are considered non-constant variables. This rules out the case: const C(x) : y = const [x]; where the current specification would, technically, allow it as a potentially constant expression and therefore be a valid const constructor. In practice it would never work if the constructor is used with "new" instead of "const". This is not really a specification *change* - existing implementations has this restriction anyway. Addressed the concern of #24970. BUG= http://dartbug.com/24970 R=eernst@google.com, gbracha@google.com Committed: https://github.com/dart-lang/sdk/commit/2a0cc74db17c3eb9883582975c8ce5165bdd8dfd

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M docs/language/dartLangSpec.tex View 1 chunk +1 line, -1 line 2 comments Download

Messages

Total messages: 13 (4 generated)
Lasse Reichstein Nielsen
5 years, 1 month ago (2015-11-19 15:30:22 UTC) #3
eernst
Tried to clarify the issue for myself, hoping that this would bring a couple of ...
5 years, 1 month ago (2015-11-20 10:03:18 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/1465473002/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/1465473002/diff/1/docs/language/dartLangSpec.tex#newcode1550 docs/language/dartLangSpec.tex:1550: A {\em potentially constant expression} is an expression $e$ ...
5 years, 1 month ago (2015-11-20 10:37:55 UTC) #6
Lasse Reichstein Nielsen
On 2015/11/20 at 10:37:55, Lasse Reichstein Nielsen wrote: > FWIW, the spec basically treats const ...
5 years, 1 month ago (2015-11-20 16:36:04 UTC) #7
eernst
On 2015/11/20 16:36:04, Lasse Reichstein Nielsen wrote: > On 2015/11/20 at 10:37:55, Lasse Reichstein Nielsen ...
5 years, 1 month ago (2015-11-20 16:57:06 UTC) #8
Lasse Reichstein Nielsen
On 2015/11/20 16:57:06, eernst wrote: > I suspect that this is developing into something that ...
4 years, 11 months ago (2016-01-14 12:22:28 UTC) #9
eernst
On 2016/01/14 12:22:28, Lasse Reichstein Nielsen wrote: > On 2015/11/20 16:57:06, eernst wrote: > > ...
4 years, 11 months ago (2016-01-14 15:10:41 UTC) #10
gbracha
lgtm
4 years, 11 months ago (2016-01-14 21:17:43 UTC) #11
Lasse Reichstein Nielsen
4 years, 11 months ago (2016-01-20 12:21:44 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
2a0cc74db17c3eb9883582975c8ce5165bdd8dfd (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698