Commit Graph

3034 Commits

Author SHA1 Message Date
Brian Wilkerson 27c4418f2d Generate an error when the first argument of an assert is a function
Change-Id: Ie6eaddaab827936a1127275b325dc6d4a3357e24
Reviewed-on: https://dart-review.googlesource.com/31963
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-05 16:53:26 +00:00
Dan Rubel 26d2805e29 Allow builtin "Function" as identifier
* Rework skipGenericFunctionType and skipTypeReferenceOpt
* Address comment in https://dart-review.googlesource.com/c/sdk/+/38500

Change-Id: Iab7b72bb579094bdc03da652a04b99493cc56f79
Reviewed-on: https://dart-review.googlesource.com/38740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-05 16:40:06 +00:00
Dan Rubel d99c2c76a3 Add fasta parser break/continue error messages
In addition to updating the fasta parser error messages, this CL
updates the recovery tests to automatically allow break/continue errors
in the valid and recovery code if those errors appear in the
base code being tested. For example, if the base code is

   main() { break; }

the invalid code is

   main() { var a break; }

and the expected recovery code is

   main() { var a; break; }

then because the base code has a break-error, then that error
is allowed/expected in both the invalid and recovery code
without being explicitly listed in the test.

Change-Id: Ic7c188d6e6fb506ee83b8c99175caab3a82444f2
Reviewed-on: https://dart-review.googlesource.com/38500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-05 12:42:57 +00:00
danrubel c2b9e16cfb Cleanup fasta parser recovery tests
* Update expectations for 40+ recovery tests based upon the current
  fasta parser code recovery and error messages so that those
  recovery tests now pass

* Improve test failure message when comparing NodeLists

* Validate expected recovery code as the first step when running
  the test and print an error message when the expected code is invalid.

* Compare the expected and actual AST structures before asserting
  expected errors

Change-Id: I824d72939fb665c3e2f83cfbbdf9c313c8ca508a
Reviewed-on: https://dart-review.googlesource.com/38460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-04 13:49:53 +00:00
Devon Carew 32beedf168 Print method params as 'foo: bar' instead of 'foo : bar'.
Change-Id: I5c50936e1ead2b39d144a4e74e37482cb49410bd
Reviewed-on: https://dart-review.googlesource.com/38421
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-04 02:02:35 +00:00
Jaime Wren 9388ac6694 Implcit new bug fix, hardcoding of flag now disabled.
Change-Id: I38f1535202cdba20e0db20f5df55eee314585ffc
Reviewed-on: https://dart-review.googlesource.com/38348
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-02 23:01:36 +00:00
Jaime Wren a1754ff2be TBR Bot fix. Hardcode previewDart2 to be false to have the Dart SDK build.
Change-Id: Ida8e3a720c7a0e06d7ec0297f4ee2ba397899848
Reviewed-on: https://dart-review.googlesource.com/38342
Reviewed-by: Jaime Wren <jwren@google.com>
2018-02-02 21:43:43 +00:00
Jaime Wren c5c5734e13 Implicit new and const work for the analyzer- add support for library prefixes: "prefix.ClassName.[constructorName]?()"
Change-Id: I9f9d59e38123bbbd5e47993a8f416603b77d47fb
Reviewed-on: https://dart-review.googlesource.com/38340
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-02 21:08:46 +00:00
Sigmund Cherem f541f060ee [fe] deferred access checks for several access patterns of classes.
This adds checks for allocations and type values, and provides a compile
time error for type declarations, is-checks, and as-casts.

Change-Id: I3bfed41b0dd45abeb02158f0537102c779511998
Reviewed-on: https://dart-review.googlesource.com/36383
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-02 20:44:16 +00:00
Brian Wilkerson cb1b28f04f Initial parser work to parse instance creation without a keyword but with type arguments
Change-Id: I23421aa7387f5c249dfa9acbe4cda2f92c3481a2
Reviewed-on: https://dart-review.googlesource.com/38166
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2018-02-02 18:07:37 +00:00
Jaime Wren e2eb5a332a Additional analyzer test for the implicit new case: "A<T>()"
Change-Id: I98981f948d0b60dc0e652257020bcd7ce833ff41
Reviewed-on: https://dart-review.googlesource.com/38146
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-02-01 21:07:18 +00:00
Jaime Wren ca0b707d2a Re-worked and refactored the resolution of implicit-new source in the analyzer resolver to make sure that any 'ClassName.methodName()' will not be mistakenly resolved as a constructor invocation.
Before any ASTs are constructed, a lookup happens to see if such a constructor exists, otherwise the AST replacement will not proceed, and even temporary ASTs will not be created: in this way we can add the test test_visitMethodInvocations_not_implicit_constructor.

Change-Id: I01e25af5d1eaec659cf02ca89f8a9a5da334e6a9
Reviewed-on: https://dart-review.googlesource.com/37920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-31 22:21:18 +00:00
Brian Wilkerson b74ceb0248 Remove a warning (issue 31351)
Change-Id: Id798aa7ece345970e3bfba15b260df6482a57074
Reviewed-on: https://dart-review.googlesource.com/37861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 20:42:26 +00:00
Brian Wilkerson 1d9ac49dd9 Reland "Add an error when an integer literal is out of bounds"
Change-Id: Id6ef76b47bedabc96fc372f6aea455975dfcc213
Reviewed-on: https://dart-review.googlesource.com/37840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 16:50:55 +00:00
Dan Rubel ec7435945d Remove findMemberName from parseTopLevelMember
This CL refactors parseTopLevelMember so that it does not scan ahead
using findMemberName. This is the next step in removing findMemberName
to improve top level declaration recovery.

Change-Id: I4d949f72cba5618541448c08e1756bf45a4d1762
Reviewed-on: https://dart-review.googlesource.com/37680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-31 12:04:56 +00:00
Jaime Wren 25d0bac724 Initial tests for the implicit new and const constructor support in the analyzer
Change-Id: Ieef3294810520aaa03f6782971ccaaeff6ddb875
Reviewed-on: https://dart-review.googlesource.com/37422
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-30 18:57:59 +00:00
Brian Wilkerson d0f105de1a Reland "Produce an error if there would be an exception thrown by an assert in an initializer list"
Change-Id: Id79a8cf949a08d56a59268b687f299f3482a1b88
Reviewed-on: https://dart-review.googlesource.com/37540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-30 14:40:19 +00:00
Samir Jindel 68554ab8f5 [kernel] Support "dart-ext:..." imports in the CFE.
They are encoded as annotations on the importing library, similarly to
how native methods are encoded.

Change-Id: I4dc1119b20949308e4856666693fe4e890e9ee87
Reviewed-on: https://dart-review.googlesource.com/35660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-29 14:04:25 +00:00
Mike Fairhurst cb7e85a26d Support void as a Top type, with as few other changes as possible.
Change-Id: Ife337e28fa86f9b98cdabf48a01a4e2f608aa4b8
Reviewed-on: https://dart-review.googlesource.com/35520
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-26 22:42:08 +00:00
Brian Wilkerson 7a36d39962 Revert "Produce an error if there would be an exception thrown by an assert in an initializer list" (TBR)
Change-Id: Iece7d75e9245cdb9d0a72ac30f6b1031a76c0755
Reviewed-on: https://dart-review.googlesource.com/37080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-26 21:54:30 +00:00
Brian Wilkerson fb739fffe6 Produce an error if there would be an exception thrown by an assert in an initializer list (2)
Change-Id: I2f268a23c3d84dfbe4bba67730e226f5b5603570
Reviewed-on: https://dart-review.googlesource.com/32740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-26 20:15:01 +00:00
Dan Rubel c31758dfee Fasta parser cleanup
Per discussion with Peter, this CL updates all begin* and handleNoType
events to take atleast one token parameter.

* Ensure all fasta parser begin* events take atleast one parameter
* Update handleNoType event to take last consumed token
* Address comment in https://dart-review.googlesource.com/c/sdk/+/36820
* Remove unused skipToLastModifier method

Change-Id: I1be25fe4327a63707f74163fa2b93452d71e7748
Reviewed-on: https://dart-review.googlesource.com/36960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-26 18:00:54 +00:00
Dan Rubel c284670f54 Refactor fasta parse class member modifiers
This CL moves modifier parsing out of parseMethod and parseFields
into parseClassMember and before findMemberName.
This is the next step in evenally removing findMemberName
and improving top level declaration recovery.

This CL also removes unused parameters from several fasta parser events.
Per discussion with Peter, tokens will be added back to each of these
events in a subsequent CL.

Change-Id: I4ffc0622b75581b5fdb527feeb19ae0b68c4eeaf
Reviewed-on: https://dart-review.googlesource.com/36820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-26 13:39:08 +00:00
Paul Berry d68fbb7454 Add new warning StrongModeCode.TOP_LEVEL_INSTANCE_METHOD.
This warning fires if a top level initializer depends on the type of a
method whose type is subject to type inference.  This warning is
needed because the analyzer implementation of top level type inference
doesn't guarantee that the method type will be inferred prior to the
initializer, so it's possible that type inference will produce an
incorrect result.  See #31925 for more details.

Change-Id: Iec048d2638877c16ae11a87eae0382b7352f726c
Reviewed-on: https://dart-review.googlesource.com/36841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-26 01:10:00 +00:00
Paul Berry 68fd556216 Rework _validateTopLevelInitializer to use a visitor.
The old implementation only validated a whitelisted set of use cases,
so it would often miss important subexpressions.  The new
implementation is based on a RecursiveAstVisitor so by default it
visits all subexpressions; we use overrides for the specific cases
where it's not necessary to visit all subexpressions.

Fixes #31963.

Change-Id: Icb9833f51bef26874f655cd2ba4ffc509bfffef3
Reviewed-on: https://dart-review.googlesource.com/36803
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-25 21:47:46 +00:00
Dan Rubel 2be7b9566f Refactor fasta parse top level modifiers
This CL moves modifier parsing out of parseTopLevelMethod
and parseFields into parseTopLevelMember and before findMemberName.
This is the next step in evenally removing findMemberName
and improving top level declaration recovery.

* New ModifierRecoveryContext2 which will soon replace
   both ModifierContext and ModifierContext2
* Remove now unused TopLevelModifierRecoveryContext
* Remove unused beginTopLevelMethod event arguments
* Remove unused handleNoType event arguments
* Address comment in https://dart-review.googlesource.com/c/sdk/+/36500

Change-Id: I6842a83d9604cdcca611d7209e3ebcc78de469d3
Reviewed-on: https://dart-review.googlesource.com/36680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-25 00:05:46 +00:00
Paul Berry 1891084dec Generate fresh type parameters prior to inferring an invocation.
This is necessary to avoid confusion when a generic function or method
recursively calls itself.

Fixes #31759.

Change-Id: I4e3be2093e9d6b81f084250435ea7493ca6b2464
Reviewed-on: https://dart-review.googlesource.com/36363
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-24 19:41:58 +00:00
Paul Berry 314b89e11d Update the analyzer to require noSuchMethod overrides to be concrete.
See 38dcb10543 for details.

Change-Id: I00608f7106e1b37cde81b8145d8d748f8cd97804
Reviewed-on: https://dart-review.googlesource.com/36520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-24 13:55:18 +00:00
Dan Rubel d5bd271430 Refactor modifiers in parseFields
This is the next step towards removing findMemberName
and improving class member and top level declaration
recovery.

* Remove modifiers from findMemberName results
* Inline modifier parsing in parseFields
* move non modifier recovery out of ModifierRecoveryContext

Change-Id: I9cb4abd7632021720ba184440f0b1af382e72794
Reviewed-on: https://dart-review.googlesource.com/36500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-24 12:18:28 +00:00
Brian Wilkerson 86b27dd577 Add a hint for unused labels (issue 31930)
Change-Id: I0d2f41fdb8a7399e6664dcf57503de84991c075d
Reviewed-on: https://dart-review.googlesource.com/36181
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-22 18:34:28 +00:00
Konstantin Shcheglov 79868e3b22 Reenable analyzer/test/generated/non_error_resolver_kernel_test.
I don't see that the test is slow, at least anymore.
It takes 9 and 14 seconds in unchecked and checked modes on my Mac.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/30796
Change-Id: I6a0453393660fac750a305cb26f837a3354a9cad
Reviewed-on: https://dart-review.googlesource.com/36280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-22 16:21:48 +00:00
Jens Johansen 76eb861729 [fasta] Add Null on the list of classes that cannot be extended
Fixes #31817.

Bug: 31817
Change-Id: I7c2f98efee57724b65692fb0daa59ca12623dbe2
Reviewed-on: https://dart-review.googlesource.com/35601
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 06:53:57 +00:00
Brian Wilkerson e95486d18e Revert "Add an error when an integer literal is out of bounds"
Change-Id: I2376904a8b92382c0f33212f41c88bafd75f3a15
Reviewed-on: https://dart-review.googlesource.com/35806
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-18 22:40:14 +00:00
Sigmund Cherem e2ad2db805 Generate checks for library-is-loaded to fasta and dart2js.
Change-Id: Ibf453ca7390b81da7231dcb1be43e426c00d6eeb
Reviewed-on: https://dart-review.googlesource.com/35100
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-18 20:17:14 +00:00
Brian Wilkerson cf7efddb0b Add an error when an integer literal is out of bounds
Change-Id: I8bc9e6e03d76822785f254ec346d82983ea63f2c
Reviewed-on: https://dart-review.googlesource.com/31841
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-18 17:30:54 +00:00
Peter von der Ahé 3fcede3c7f Short-term hack to work around issue with duplicated interfaces.
See dartbug.com/31656

Change-Id: I017085953c5ac41d2cfd7368752918c6fcb51144
Reviewed-on: https://dart-review.googlesource.com/33884
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-18 14:10:15 +00:00
Dan Rubel 69dfe14453 Improve local modifier recovery
In addition to inlining and improving local modifier recovery,
this CL also cleans up several tests and addresses comments
in https://dart-review.googlesource.com/c/sdk/+/35300

Change-Id: Icf0ad8afdb923e52f43e4d8fa91b1731ab99089c
Reviewed-on: https://dart-review.googlesource.com/35500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-18 12:18:56 +00:00
Paul Berry 23cba1d438 Issue a warning if top-level inference depends on an implicitly typed instance getter.
If an implicitly typed top level variable or field depends on an
implicitly typed instance getter or instance field, the analyzer
implementation of type inference isn't guaranteed to infer the
depended-upon field first, therefore the type might be inferred
incorrectly.

The new front end doesn't have this problem, so the user's code will
execute correctly at runtime, but they might get confusing results
from the analyzer.  To alert users of this problem, we issue a
compile-time warning whenever an implicitly typed top level variable
or field depends on an implicitly typed instance getter or instance
field.

Change-Id: I100bcbe1a76472bcb7d493eb12e4a3e2d0605e79
Reviewed-on: https://dart-review.googlesource.com/35385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-17 21:58:28 +00:00
danrubel 6f6689889c Update fasta parser to report ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR
In addition to adding missing errors, this CL inlines modifier parsing
as part of a multi step effort to parse modifiers once and provide
better error recovery for class member and top level declarations.

Change-Id: Ibea91a4a3e2073ed6079f0f44ff4bbbb4a98a614
Reviewed-on: https://dart-review.googlesource.com/35300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-17 18:28:48 +00:00
Paul Berry 10042c74e3 Fix test_await_flattened in non_error_resolver_test.
This test was broken by 45b02f8216,
which changed the behavior of flattening in the kernel driver.
Unfortuately the error wasn't picked up by the build bots because the
test is disabled - see #30796.

Change-Id: I93f488f066434afbeaaa6b82ceb9ac1278574861
Reviewed-on: https://dart-review.googlesource.com/34920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-16 18:30:34 +00:00
Dan Rubel b79696982d Improve extraneous or out of position modifier recovery
In addition to improving modifier recovery, this CL
* Improves recovery when builtin keywords are used as types
* Updates ModifierContext to avoid parsing modifiers used as identifiers
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/34200
* Streamlines missing class body recovery
* Ensures the endMember event is sent during recovery

Change-Id: I87bda7c7da9d0e951427037087c7aa7e8e4da109
Reviewed-on: https://dart-review.googlesource.com/34520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-16 17:24:12 +00:00
Dmitry Stefantsov 10058a3600 Use instantiate to bound in body builder of fasta
Change-Id: I6e3d9f60c43ccb34df0b58c635be51ea0aa2e789
Reviewed-on: https://dart-review.googlesource.com/32600
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-15 14:56:41 +00:00
Paul Berry 45b02f8216 Use the new spec for Future flattening for type inference
Change Fasta type inference and Kernel type checking to use the new
definition for Future flattening, which is really unwrapping (peeling
off one layer of Future or FutureOr).  Use this for inferring types of
`await` expressions and return types from `async` functions.

Ensure that we are using the same notion of flattening for inference
and checking.  (Maybe it was a red flag that we weren't.)

This fixes await_test so that it produces a runtime error rather than
a compile time error - see #31541.

A similar change will need to be made to the analyzer - see #31887.

Change-Id: I7d936e9788969a48fdc216628eaa793389fb5e30
Reviewed-on: https://dart-review.googlesource.com/34504
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-15 07:09:36 +00:00
Mike Fairhurst 90f9fa5664 Fix #28513 Force an order of LUB/GLB on equivalent Top types.
A fairly internal case, so I ended up guarding it semi-heavily with
asserts, which could go against convention, but seems fairly safe here.

Two tests: One that sanity checks some edge cases & exemplary values,
and another one that checks each combination programmatically. Together
they should be the best coverage; both the reliance of computers and
the simplicity of specific cases.

Should be very easy to pop in the void type here next.

Bug: 28513
Change-Id: Id20811a77b4de3f2c4ede7a77e1da5a114432e97
Reviewed-on: https://dart-review.googlesource.com/34305
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-12 18:33:59 +00:00
Dan Rubel 8a0a6b5a98 Update analyzer fasta parser test expectations
In addition to updating test expectations, this CL also
* Streamlines parsing modifiers in 2 places
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/33500

Change-Id: Ia3d4b7db8a908455b533c1360d107d3557fbb36f
Reviewed-on: https://dart-review.googlesource.com/34200
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-11 21:57:58 +00:00
Mike Fairhurst 095232c71f Expansion of https://dart-review.googlesource.com/c/sdk/+/33660, which
solves the generic function type scoping problem (fixes the test).

Includes further failures documented here:
https://github.com/dart-lang/sdk/issues/31804 with @failingTests.

These do seem to fail today as is, so it should be safe to land.

Bug:
Change-Id: Ice384b6fee35f1b1c4235bb0e4de7a90e2379937
Reviewed-on: https://dart-review.googlesource.com/33582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-11 21:45:48 +00:00
Konstantin Shcheglov 1514e3f276 Resolve labels while applying resolution.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1d50d251e04a51a1ba0c6038592982988c3281b2
Reviewed-on: https://dart-review.googlesource.com/33666
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-10 16:53:09 +00:00
Dan Rubel 729e7b2920 Refactor fasta parser modifier recovery
This CL extracts parsing modifiers from parsing types so that
parseModifiers just parses modifiers and a separate call is made
to parseType.

* Discard the ModifierContext object sooner
* Remove some places where findMemberName output was being
   used to determine which modifiers are present.

Currently, modifiers are parsed once by findMemberName,
again by parseModifiers, and sometimes a third time
by isFactoryDeclaration. This CL sets the stage for
improved modifier recovery and parsing modifiers exactly once.

Change-Id: Ieb8cd1156ed090ca4653258bd40afbac843b9b7c
Reviewed-on: https://dart-review.googlesource.com/33500
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 14:30:38 +00:00
Konstantin Shcheglov 4e9e5d0569 Assign analyzer codes to several FrontEnd errors.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I2cf2a948048245e016f0f3d316dcf889c4bde31d
Reviewed-on: https://dart-review.googlesource.com/33583
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:25:48 +00:00
Konstantin Shcheglov f99d3628d1 FrontEndCompiler that computes all information about many libraries at once.
Before we used a hack to request resolution information for a single
library as needed, and requested kernels separately. This was hugely
inefficient (but faster to implement as a steel thread). We had then
recompile large library cycles many times, and take just one library.

Before: 480 seconds to compile analyzer (ouch!).
Now: 16 seconds (30 times faster).

Without --previewDart2: 14 seconds.

I will check why it is still slower later.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ic3d47684daa74c53f0336523e17b656f26328acf
Reviewed-on: https://dart-review.googlesource.com/33144
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-09 07:05:54 +00:00