Commit Graph

4770 Commits

Author SHA1 Message Date
danrubel 7dacba68d1 Improve fasta parser local variable declaration recovery
Change-Id: I586496953791a6755bb47e0199f786a5cee0d5aa
Reviewed-on: https://dart-review.googlesource.com/52360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-23 23:18:32 +00:00
danrubel 07daecf36f Improve fasta parser skip type variables
Change-Id: Icbf546a496dd1665615e4cb70d3fa130f770413d
Reviewed-on: https://dart-review.googlesource.com/52301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-23 16:45:42 +00:00
danrubel 0e46a199fc Fix type reference prefixed annotation recovery
When recovering from an invalid annotation in a type variable
(e.g. "< @Foo.bar T >"), the parser could get stuck in an
infinite loop trying to recover. This fixes that situation.

Change-Id: If01e43b9eec575824329808eeb93437432830654
Reviewed-on: https://dart-review.googlesource.com/52300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-21 15:28:31 +00:00
Dan Rubel 313b5bd191 Rename TypeInfo subclasses and constants
Rename the TypeInfo constants and related constants in preparation
for refactoring and improving type argument and type parameter parsing.

Change-Id: I5a741ee06f373800973942c233490fe83916e39c
Reviewed-on: https://dart-review.googlesource.com/52140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 16:07:39 +00:00
danrubel 10b441b16b Improve conditional import expression recovery
This improves recovery when parsing conditional import expressions
by repositioning the synthetic closing ')' that was inserted by the
scanner in a less than optimal location.

This approach relies on the beforeSynthetic field being set correctly.
While the scanner still sets the 'next' and 'beforeSynthetic' fields
directly for efficiency, most other functions which update an existing
token stream have been revised to call 'setNext()' rather than setting
the 'next' field directly. This ensures that the 'beforeSynthetic' field
will be correctly updated.

Change-Id: Id631fd600c64d1feaf00593acb74a7070e354f07
Reviewed-on: https://dart-review.googlesource.com/52120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 13:58:50 +00:00
Dmitry Stefantsov 1f7fa3e1ad Revert "[fasta] Handle annotations on formals and variables"
This reverts commit 0289071afe.

The reverted commit breaks precomp bots.

Change-Id: I3218d5a0779e1f30f4172ede2294be558ded2abd
Reviewed-on: https://dart-review.googlesource.com/52103
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-20 13:32:59 +00:00
danrubel be741ba511 Add beforeSynthetic field for synthetic ")", "]", and "}" tokens
This CL updates SyntheticToken to have a new beforeSynthetic field
and the fasta scanner to set that field for synthetic ")", "]", and "}" tokens.
This makes it much more efficient for the parser to move a synthetic
closer when the scanner has inserted it in a less than optimal location
in the token stream.

This CL also addresses a comment in
Address comment in https://dart-review.googlesource.com/c/sdk/+/51561

Change-Id: I7f056ac25f2ca4cf5edb0ef4bce7f1e9dd76de9a
Reviewed-on: https://dart-review.googlesource.com/52040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 12:21:09 +00:00
Dmitry Stefantsov 0289071afe [fasta] Handle annotations on formals and variables
Bug: http://dartbug.com/28434
Change-Id: If386d24f95d14a38150c9316caf7a17065583e32
Reviewed-on: https://dart-review.googlesource.com/51840
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-20 11:19:39 +00:00
Dan Rubel bdfcc20846 Improve fasta parser formal parameter recovery
This CL improves recovery given invalid or malformed formal parameter
types and identifiers. This accomplished by switching the
parseFormalParameter method to use computeType rather than parseType,
improving recovery when parsing field initializers, and in the process,
further reducing the size of parseType and eliminating 6 unused
TypeContinuation elements.

Change-Id: I6f05d8018bf8d9f2c256e5a64408c29db006a8e2
Reviewed-on: https://dart-review.googlesource.com/52000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 20:25:58 +00:00
Dan Rubel 499b6ba4cf Improve fasta parser computeType recovery
This CL improves recovery when a type is required to interpret
"Foo.", ".", and ".Foo" as malformed prefixed type references.
When a type is *not* required, each of the above are still interpreted
as no-type-reference.

Change-Id: Ia20caa8619821d24c5b16fd0015cee03987ee2a6
Reviewed-on: https://dart-review.googlesource.com/51900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 16:08:49 +00:00
Aske Simon Christensen 2b09c1efc0 Revert "Error on missing method implementation in non-abstract class"
This reverts commit 7cc55d0372.

Reason for revert: More test fixes needed.

Change-Id: Ib36159184ffbd14ce3f7cca184ce2b8cdfec237c
Reviewed-on: https://dart-review.googlesource.com/51680
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-18 17:27:22 +00:00
Aske Simon Christensen 7cc55d0372 Error on missing method implementation in non-abstract class
Closes https://github.com/dart-lang/sdk/issues/32013

Change-Id: I8f49d2640ef92a3d9d723969208cdb5f397e806d
Reviewed-on: https://dart-review.googlesource.com/43660
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-18 14:39:09 +00:00
danrubel 17d7f23e71 Improve fasta parser conditional import recovery
Change-Id: I5479078d8d2c3de10b74ed04001fdd852a427c5c
Reviewed-on: https://dart-review.googlesource.com/51561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-18 11:04:19 +00:00
Aske Simon Christensen 9988941a37 Rewrite Dart SDK file URIs in test expectations.
Solves problems with absolute Dart SDK file URIs appearing in
expectations files, causing incompatibility between local runs and bots.

Change-Id: I75c5a167834503fa6ffea3b34f6d647e78a46adf
Reviewed-on: https://dart-review.googlesource.com/50700
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-18 10:55:49 +00:00
Dan Rubel 8e812ddaa5 Pass modifiers in beginFormalParameters event
This CL updates the beginFormalParameters event to include
the covariant and const/final/var modifiers, and cleans up
a number of unused classes and methods including:

* the original implementation of ModifierContext/Recovery
* handleModifier and handleModifiers events

Change-Id: Ie89a202d17872fba85cd1a477091472a8d2d223b
Reviewed-on: https://dart-review.googlesource.com/51380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-17 20:27:37 +00:00
danrubel 0fabb9df42 Move dottedName identifier recovery to IdentifierContext
Change-Id: I7cf764d0bac99f08549e2b399e9a307345ea06e0
Reviewed-on: https://dart-review.googlesource.com/51560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-17 20:18:38 +00:00
Dan Rubel 9e3d94ba94 Move class name recovery into ClassOrNamedMixinIdentifierContext
Change-Id: I608c6a0a9f22cbfaf3a5193c0d57c628768475da
Reviewed-on: https://dart-review.googlesource.com/51480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-17 19:01:17 +00:00
Kevin Millikin dff3b8f301 Remove MethodInferenceNode
During top-level type inference, method types are inferred
immediately.  There is no need to have MethodInferenceNodes which
exist for the purpose of delaying type inference.

Change-Id: I0044ab64a31e43ca807db75631ee8fa259c07a22
Reviewed-on: https://dart-review.googlesource.com/51320
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-04-17 12:49:17 +00:00
Peter von der Ahé aaff238f8f Use import URIs when invalidating files
Change-Id: Ie260454127e39141bd02578d2511131ea30a2088
Reviewed-on: https://dart-review.googlesource.com/48180
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-17 11:36:57 +00:00
Kevin Millikin e7a7ad89df A pair of simple cleanups in top-level inference
Create a single return in ForwardingNode._finalize to make it easier
to inline and specialize.  Use for-in instead of raw iterator methods
in MemberInferenceNode._matchTypes to make it more obvious.

Change-Id: Ie35618fa57db41b8bc070d9cbed46bb717399605
Reviewed-on: https://dart-review.googlesource.com/51300
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-04-17 10:08:37 +00:00
Jens Johansen f9516e0c98 Forgo bit-perfect result in incremental compiler.
This CL removes the library sorting the produces a (more) bit-perfect
result when initializing from a dill file.
In general it is not needed, and was only added to satisfy tests,
but sorting is now done in the tests instead.

Change-Id: I71e968720439ab6dacd07e6039990915ce4c1286
Reviewed-on: https://dart-review.googlesource.com/49162
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-17 09:26:50 +00:00
Jens Johansen 446463afb3 Cleanup in incremental compiler
This is the 2nd attempt.
First attempt was committed as 5367304ba5
but was reverted as 2676c132cb
This attempt forgoes the "handles change package versions" as it creates
problems for flutter. A subsequent CL the handles it better will be
created later.

This CL addresses comments from previous CLs, mostly renaming variables.

Fixes #32776.

Change-Id: I634056069d3e8c3e41ba349ccd0fe5ffa5f99458
Reviewed-on: https://dart-review.googlesource.com/49510
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-17 08:49:22 +00:00
danrubel 0ca8b6e5be Improve recovery when "assert" is used in an expression
Change-Id: I01e8c6fbe0faf6ce6ded32b2cfa1ec034f22588d
Reviewed-on: https://dart-review.googlesource.com/51341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-16 20:20:49 +00:00
danrubel 8df94f34fd Improve fasta parser await-for statement recovery
Change-Id: I8b3896437f6ed9d51bb79927dc7387103237d817
Reviewed-on: https://dart-review.googlesource.com/51340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-16 18:20:18 +00:00
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Peter von der Ahé 0cbd4b520a Address review comments from change 51120
Change-Id: I017fae6b5bc2c9f8afacd08e9e4d6a1edff2d1db
Reviewed-on: https://dart-review.googlesource.com/51127
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-04-16 12:13:01 +00:00
Dan Rubel ce2b0db370 Improve fasta parser "assert" recovery
Change-Id: Idf5a9c7fd73a0a4b34ab26fdf1032a516750928d
Reviewed-on: https://dart-review.googlesource.com/51180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-15 21:52:22 +00:00
Peter von der Ahé 974a8ee21d Fix crash in named function expression
Fixes https://github.com/dart-lang/sdk/issues/32694

Change-Id: Idfc2dbe11e44d6d927924a6fc54cf31cee66a6ae
Reviewed-on: https://dart-review.googlesource.com/51120
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-04-13 12:02:47 +00:00
Peter von der Ahé 988de9c925 Thread forest object through calls
Change-Id: I4365fca44761c27609c28ac8c36b031e06caf0de
Reviewed-on: https://dart-review.googlesource.com/51124
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-04-13 11:36:16 +00:00
Kevin Millikin a8578eaf69 Clean up some imports in Fasta type inference
It looks like we are importing messages.dart twice which should be
unnecessary.

Change-Id: If2d752920fb1ef70d1fd2db02c7915189b840a91
Reviewed-on: https://dart-review.googlesource.com/51122
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-04-13 09:49:26 +00:00
Dan Rubel e9616da13e Cleanup TypeInfo
This CL cleans up the TypeInfo library including:
* moving ComplexTypeInfo to type_info_impl.dart
* splitting up and enhancing the tests
* adding a new ensureTypeOrVoid method for use in a subsequent CL

Change-Id: I2d13f74152f8c4eb2e8b3ee504f108225cfa60eb
Reviewed-on: https://dart-review.googlesource.com/51080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-13 09:25:47 +00:00
Sigmund Cherem ff24a5ee6b fasta: make strong-mode inference aware of the type of LoadLibrary and CheckLibraryIsLoaded
Closes https://github.com/dart-lang/sdk/issues/32841

Change-Id: I270b11b33460b66cd400fa8145ce5e968096a2bf
Reviewed-on: https://dart-review.googlesource.com/50622
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-12 19:44:51 +00:00
Peter von der Ahé 1e312819ca Ensure errors guard erroneous expressions.
This changes wrapInCompileTimeError so we are certain that
compile-time errors are reported before the erroneous nodes.

We want to preserve erroneous nodes as, long term, this should help
with code completion.

Also introduce a located version as my next CL I'll have slightly
more accurate locations.

Change-Id: Id83d4b7a7d4fe260916816d72fac331251bad948
Reviewed-on: https://dart-review.googlesource.com/50422
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-04-12 14:51:19 +00:00
Dan Rubel 58a6bfd974 Improve identifier recovery in expressions
Change-Id: I6af7f3398953d1f98dd186564af92da14d015f2a
Reviewed-on: https://dart-review.googlesource.com/50560
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-12 12:57:18 +00:00
Jens Johansen df6055d876 Only bypass cache when .packages is invalidated
In a86b864fa9 the incremental compiler was
updated to always bypass the cache when getting a UrlTranslator to be
able to handle the case where .packages had been updated.

This was driven by Flutter not invalidating .packages.

This has now been introduced in flutter with
https://github.com/flutter/flutter/pull/16467
and we can now limit when we bypass the cache to when the .packages file
has been invalidated.

This CL does just that, and further more adds tests where .packages either
appears or disappears.

Change-Id: I3e2d001a993a59c115bc00fcf714f97094357d35
Reviewed-on: https://dart-review.googlesource.com/50940
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-12 11:40:44 +00:00
Jens Johansen 5aec8ad6fb Delete invalidated builder loaded from dill
Prior to this CL a builder loaded from a dill file - but where the
file has now been deleted (and we've previously been told about it) -
was kept around, meaning that it could get resurrected in a later
call to computeDelta.

This CL introduces a test and fixes the problem.

Change-Id: Ia18639a1387b37f8d641f803f202288dd185af5c
Reviewed-on: https://dart-review.googlesource.com/50722
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-12 10:27:24 +00:00
Jens Johansen 218d9fb34c Keep unused package builders in memory
e6962790a1 introduced a speed-regression
e.g. by increasing the time it takes to run `flutter test` in
flutter/packages/flutter from ~2:30 to ~3:10.
This regression was caused by making the functionaliy that removes
unused builders work for packages too.

Before that commit landed we tried to remove unused "package:*" builders,
but failed because we tried to remove them by their fileUri and not the
importUri (which they are actually saved under). The commit (among other
things) fixed that (i.e. they are now removed by their importUri).

This CL "re-introduces" the "don't remove unused 'package:*' builders"
functionality - though this time by design.

This reduces the time it takes to run `flutter test` in
flutter/packages/flutter and gets it back down to ~2:30.

Change-Id: I335ae3d473b0a0eda955741e5e3ce4c946916452
Reviewed-on: https://dart-review.googlesource.com/50662
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-11 10:16:13 +00:00
Dmitry Stefantsov 0b89634cdf [fasta] Clean-up after the attempts to approach magic const
Change-Id: Ice199a017ca88a1c31893eb75558f28bf6632b18
Reviewed-on: https://dart-review.googlesource.com/50661
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-04-11 08:49:31 +00:00
Kevin Millikin 74cf86cbbb Remove Kernel's DispatchCategory
It complicates the intermediate language, none of the back ends are
using it, and it's not something that we want transformation writers
and code generators to deal with.

Change-Id: Ic79f7935dd8619bd233346bb25947e864f38a104
Reviewed-on: https://dart-review.googlesource.com/50440
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-04-11 07:43:41 +00:00
danrubel 5c508ff785 Update more IdentifierContext type reference recovery
Change-Id: I7268bce4379ac4613ecd182c9d41022f2a08e7c4
Reviewed-on: https://dart-review.googlesource.com/50521
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-10 19:38:41 +00:00
Aske Simon Christensen bd39320b3b Recover from error on undefined continue label.
Closes https://github.com/dart-lang/sdk/issues/32800

Change-Id: Idbd11f1c17affc1e9a6dd7f4c6999464bac8982e
Reviewed-on: https://dart-review.googlesource.com/50220
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-10 14:33:11 +00:00
Jens Johansen e6962790a1 Use import URIs when invalidating files
Fixes https://github.com/flutter/flutter/issues/16368
Note that this is mostly a copy of
https://dart-review.googlesource.com/c/sdk/+/48180

Change-Id: Ibdf7719d8b362a4c179fd7a4a6ab5ae7028a5429
Reviewed-on: https://dart-review.googlesource.com/50420
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-10 13:52:42 +00:00
Aske Simon Christensen 290cc58e71 Use actual receiver when error-wrapping a null-aware property get.
Fixes the crash on conditional_property_access_test_{05,06}.dart
from https://github.com/dart-lang/sdk/issues/32800

Change-Id: Ic3928b345c235472d6632e8bc443f28d59b81f6b
Reviewed-on: https://dart-review.googlesource.com/49920
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-10 13:24:29 +00:00
Jens Johansen a86b864fa9 Handle updated .packages in incremental compiler
Change-Id: I6de6cb643b14b14ce54944f57b9e15f502750206
Reviewed-on: https://dart-review.googlesource.com/49901
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-10 10:57:31 +00:00
Dan Rubel 5e99872770 Improve missing/invalid type reference recovery
Change-Id: I52231fba7ebce51242393a0030325198bf51dfbf
Reviewed-on: https://dart-review.googlesource.com/50340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-09 22:53:28 +00:00
danrubel 8abbb2eb4b Remove unused SubStringScanner
Change-Id: I49502dcbf3d3520814730ca3bdbd7fb67f2e8751
Reviewed-on: https://dart-review.googlesource.com/50000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-07 00:10:43 +00:00
Dmitry Stefantsov 0fedb9b9d8 [fasta] Disable upwards new/const completion
Change-Id: If2c14bf402bbcbacbf4cf2da351eb7234e1e0944
Reviewed-on: https://dart-review.googlesource.com/49900
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-04-06 19:31:22 +00:00
Dan Rubel fd87a11ad0 Update fasta parser to generate error when "throw" missing expression
Change-Id: I6610400204e111a3a6cc7971159bfdd6c2e58794
Reviewed-on: https://dart-review.googlesource.com/49880
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-06 16:10:12 +00:00
Peter von der Ahé 60af3baf4d Implement type arguments to implicit creation
Fixes https://github.com/dart-lang/sdk/issues/30922

Change-Id: If9806d0ec5e1cfcc3ae3bd008f3ad3aa1f518a34
Reviewed-on: https://dart-review.googlesource.com/41261
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-06 11:00:22 +00:00
Dmitry Stefantsov eb3669717c [fasta] Make ConstnessEvaluator evaluate potential constness
Potential constness is determined syntactically, based on the shape of
the expression and potential constness of its nodes.  Constants are not
evaluated in any way, and their values and types don't affect potential
constness of expressions.  'Const' is inserted on a constructor
invocation if it is potential const; 'new' is inserted otherwise.

Bug: http://dartbug.com/32737
Change-Id: Ice13803ebe3abf0a0f47cbbff29d13638c2d8e92
Reviewed-on: https://dart-review.googlesource.com/49683
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-04-05 16:55:00 +00:00