Commit Graph

4163 Commits

Author SHA1 Message Date
Konstantin Shcheglov dcefeb17b6 Set ClassElement implicit instance creation.
I also changed tests to be a bit more specific - test whether elements
are class and constructor where one is expected. Not found additional
problems though.

R=brianwilkerson@google.com

Change-Id: I95cf57e46620149740d6c748a6065b3b2e00409e
Reviewed-on: https://dart-review.googlesource.com/42027
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 19:49:57 +00:00
Konstantin Shcheglov 6e912ff3ed Don't cast to LibraryElementImpl.
Also run PreviewDart2Test with analysis driver, that's how it is actually
used.

R=brianwilkerson@google.com

Change-Id: I6757d7435c376a07fa1ef00b495b5fab0d118924
Reviewed-on: https://dart-review.googlesource.com/42023
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 18:17:07 +00:00
Konstantin Shcheglov 670c288711 Issue 32162. Fix for crash in generic function type argument of unresolved class.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32162
Change-Id: I0a2df5bf5a08b52a7eb47e1b8265b9bbbf65e599
Reviewed-on: https://dart-review.googlesource.com/41922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 01:01:16 +00:00
Konstantin Shcheglov d9a44c9dc7 Revert "Normalize Windows drive letters to uppercase for analysis"
This reverts commit 56acaee9b1.

See https://github.com/dart-lang/sdk/issues/32186

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

Change-Id: I76c673758e4b9acd22044985b4054b5504f4a205
Reviewed-on: https://dart-review.googlesource.com/41902
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-15 22:10:56 +00:00
Mike Fairhurst 470f28e3c6 Fix #31345 include analysis_options breaks some properties
Bug: 31345
Change-Id: I8d588cc49931ccb4699cc33c8e12a7f701a0a513
Reviewed-on: https://dart-review.googlesource.com/41500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-14 21:32:44 +00:00
Dan Rubel dd0a08a75e Improve fasta parser error reporting
This CL updates the fasta parser to report more errors
and have improved recovery. The new errors reported include:

* IllegalAssignmentToNonAssignable
* MissingAssignableSelector
* StaticConstructor

In addition, a number of test expectations were updated
to match the errors already produced by the fasta parser.

Change-Id: I99889e8e64663ca5b81a5d5d8f5e5241d049a0a2
Reviewed-on: https://dart-review.googlesource.com/41100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 18:01:14 +00:00
Brian Wilkerson a83bcc8235 Check for unresolved imports too avoid breaking when handling optional new and const (issue 32150)
Change-Id: Ia7cc162e0e615ce324acb230e1d0bbf59d89ffa1
Reviewed-on: https://dart-review.googlesource.com/41380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 17:42:13 +00:00
Brian Wilkerson 75a2a1524f Support updated optional new and const spec
Change-Id: I974185eba4936f14d7b9d5d1d5c1638a37624c62
Reviewed-on: https://dart-review.googlesource.com/41024
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-14 17:12:13 +00:00
Paul Berry 421db9c69c Re-land "Implement proper checking for callability of Function class."
(was reverted in https://dart-review.googlesource.com/c/sdk/+/40980
due to an analyzer bot breakage)

Original commit message:
Implement proper checking for callability of Function class.

There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: Ice5cf38bbc648badf7f2563ff930b69f9a799635
Reviewed-on: https://dart-review.googlesource.com/41120
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-14 11:30:23 +00:00
Paul Berry 35aea15097 Revert "Implement proper checking for callability of Function class."
This reverts commit 6837dafcc3.

Reason for revert: Broke analyzer bots.

Original change's description:
> Implement proper checking for callability of Function class.
> 
> There was some old (incorrect) logic for doing this, behind the flag
> enableStrictCallChecks.  This flag has been removed, since the new
> behavior is now standard in Dart 2.0.
> 
> Fixes #31509
> 
> Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
> Reviewed-on: https://dart-review.googlesource.com/40509
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

Change-Id: Ib631ad16bc5e937ff914127d1c5330f3fcaff2c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/40980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-13 19:56:35 +00:00
Danny Tuppeny 56acaee9b1 Normalize Windows drive letters to uppercase for analysis
This fixes #32095, ~~however I'm currently unable to get the tests running locally. I'll continue to work on that, but I'm hoping that creating a PR runs all the tests on CI so we should at least get to see if this (legitimately) broke anything in the meantime?~~

Turns out this also fixes #32042! I can't run the latest analyzer code against a version of the SDK that the flutter_tools is happy with, however I rolled my analyzer code back to `2.0-dev.22` and repro'd this error, then applied the same changes from this PR to that version, and the errors went away.

Turns out to also fix #28895!

@bwilkerson

Closes #32133
https://github.com/dart-lang/sdk/pull/32133

GitOrigin-RevId: 94cc37479214beaf1c8e3e2befa9bef882dbcd5d
Change-Id: I32a5ce52c7b28e1d484c1e5e9a9dd6d64c2b1b3b
Reviewed-on: https://dart-review.googlesource.com/40720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-13 19:36:36 +00:00
Paul Berry 6837dafcc3 Implement proper checking for callability of Function class.
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
Reviewed-on: https://dart-review.googlesource.com/40509
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-02-13 14:19:08 +00:00
Mike Fairhurst 7a0a9284ba Relax void errors: no error assigning void to void variable (+tests)
Change-Id: I1a6e80125dff6f766c9a74b760b557609a2544fb
Reviewed-on: https://dart-review.googlesource.com/40507
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-12 21:24:19 +00:00
Konstantin Shcheglov 3791ddb496 Keep unresolved import/export directives for task based analysis.
Bug: https://github.com/dart-lang/angular/issues/801
Change-Id: If8bdcbfdc10d3aae914391573c5eb2e7beb26a8f
Reviewed-on: https://dart-review.googlesource.com/40600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-12 21:20:49 +00:00
Paul Berry a895c9b283 Promote TOP_LEVEL_CYCLE to an error
Top level type inference cycles constitute a compile-time error in
Dart 2.0.

Change-Id: I8663ea126fec2a4f495ee77125e9145372855934
Reviewed-on: https://dart-review.googlesource.com/40260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-12 11:04:48 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Dan Rubel d4f2f9cef2 Update fasta parser to report constructor initializer errors
This CL updates the fasta parser to report three additional
errors in constructor initializers:

* ExpectedAnInitializer
* MissingAssignmentInInitializer
* RedirectingConstructorWithBody

I also added a comment from a discussion about
https://dart-review.googlesource.com/c/sdk/+/39320

Change-Id: Iecb6fe97e3612a11ccc89864a4fc9f353846504c
Reviewed-on: https://dart-review.googlesource.com/40040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-08 18:08:40 +00:00
Paul Berry 2f8b0ff200 Remove unused import
Change-Id: I60a43113afcff04eedf3cab44223ce180fd77e97
Reviewed-on: https://dart-review.googlesource.com/39902
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-08 15:52:11 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Brian Wilkerson 217110c2db Use TypedLiteralNode.isConst in more places and fix a bug to improve the optional new/const support
Change-Id: I2839b0c269796fedb7a3e7340388bb3576ac6b59
Reviewed-on: https://dart-review.googlesource.com/39424
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2018-02-07 17:00:51 +00:00
Paul Berry f299f2d00f Remove error code TOP_LEVEL_TYPE_ARGUMENTS, which is no longer used
Change-Id: Ic41373617a5c96906840ac49bc13825323b486c6
Reviewed-on: https://dart-review.googlesource.com/39560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-07 14:41:42 +00:00
Paul Berry d9d2dc405b Infer mixin types in the analyzer.
This follows Leaf's simplified suggestion.  As a temporary hack it
assumes that the mixin passes its type parameters through to its
superclass constraint unchanged.

Change-Id: I091b44005d6364a91e20578f2ff6340334b1fab6
Reviewed-on: https://dart-review.googlesource.com/38040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-07 10:45:39 +00:00
Lasse R.H. Nielsen 6f78471687 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-07 06:12:53 +00:00
Dan Rubel b2c5415db9 Rework parseClassMember to remove findMemberName
This CL finishes the process of removing findMemberName from parsing
class members and sets the stage for improved recovery.
In addition, this CL:

* Revises the `endMethod` event to include a beforeParam token
    so that the parser can revise the token stream before the parameters
    during recovery.

* Reworks insertSyntheticIdentifer for use in more places

Change-Id: If5bcd6f554053f72429e938b5cd5e7021e03d5b3
Reviewed-on: https://dart-review.googlesource.com/39320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 21:01:53 +00:00
Dan Rubel e1e7ab1c3d Fasta parser cleanup
This separates and cleans up externally called fasta parser methods
such as parseTopLevelMember and parseMember from internal callers.

* Split external and internal calls to parseTopLevelMember
    so that external callers use parseTopLevelMember
    and internal callers use parseTopLevelMemberImpl.

* Rename the externally called parseMember --> parseClassMember
    and the internally called parseClassMember --> parseClassMemberImpl

* Revise the insertSyntheticIdentifier method and cleanup some
    exiting recovery code to use it.

Change-Id: Ic66ddcbbe761937bb917c679590fc7de2fdd0396
Reviewed-on: https://dart-review.googlesource.com/39080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 16:34:43 +00:00
Brian Wilkerson a0cfe5aa65 Fix more issues related to optional new and const
Change-Id: I0c1302c9b0505694853175f2b756c134e0caba19
Reviewed-on: https://dart-review.googlesource.com/38900
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2018-02-06 16:10:53 +00:00
William Hesse 9c35cff5cd Revert "New methods on Iterable, List, Set, Queue, Map."
This reverts commit 0b59f24f97.

Reason for revert: Creates crashes in dart2js with kernel, see
https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-d8-minified-1-5-be/9751

Original change's description:
> New methods on Iterable, List, Set, Queue, Map.
> Changes signature of Iterable.singleWhere.
> Makes LinkedHashMap no longer be a HashMap.
> 
> Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
> Reviewed-on: https://dart-review.googlesource.com/32541
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com

Change-Id: Iab904f5885a5213ae2e16ef496eed0b6843185f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39060
Reviewed-by: William Hesse <whesse@google.com>
2018-02-06 13:32:19 +00:00
Lasse R.H. Nielsen 0b59f24f97 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-06 11:17:46 +00:00
Mike Fairhurst 30e0c886e4 Allow no return in a Future<void>, test for FutureOr<void>.
The latter was already passing (because FutureOr<void>.isVoid is true
already, which was a condition of early bailout for MISSING_RETURN).

The former was not working, but is now handled.

Unit tests for each.

Change-Id: I0f6e7ddc71940517c5746c1a5431f4491ee2eef3
Reviewed-on: https://dart-review.googlesource.com/37440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-05 23:13:05 +00:00
Konstantin Shcheglov c16575c1f2 Issue 30884. Index MethodInvocation type arguments.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/30884
Change-Id: I0597d56d72fbff804ecf1a2f435815d02678eba6
Reviewed-on: https://dart-review.googlesource.com/38784
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-05 19:34:46 +00:00
Brian Wilkerson 6b23aec701 Correctly resolve constructors in generic classes
Change-Id: I88a30b151b3177d6ae628c50bb51aceb48a70e7a
Reviewed-on: https://dart-review.googlesource.com/38780
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-05 19:19:37 +00:00
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
Brian Wilkerson e8a43ecd56 Make ConstantAstCloner insert a const keyword where one is implied
Change-Id: I9056d408c3d58ff684534553e544a249ceb68591
Reviewed-on: https://dart-review.googlesource.com/38400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-05 13:36:48 +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
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
Jenny Messerly 85cfbebd76 Fix constKeyword usage in DDC in preparation for implicit new/const
Change-Id: Iad3d38449dbe5bbb71d470cf085c2c071432abf5
Reviewed-on: https://dart-review.googlesource.com/38147
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-02 20:33:46 +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
Brian Wilkerson 49e04b7875 Add an isConst getter to TypedLiteral
Change-Id: Ia884fe5aa6ba9b40ba5ef8c342c2312b3dd2ea77
Reviewed-on: https://dart-review.googlesource.com/38140
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-01 19:23:38 +00:00
Brian Wilkerson 30fa9c93af Clean up AnalysisOptions API
Change-Id: I54b7ba69cc1e03d38844abac7fdba07ba6c3c578
Reviewed-on: https://dart-review.googlesource.com/38080
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-01 17:50:38 +00:00
Brian Wilkerson 02fa885504 Add inConstantContext to Expression and use it
Change-Id: I1075afbe99f7d71b42b2a4074827bb91ea195a46
Reviewed-on: https://dart-review.googlesource.com/38001
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-01 17:25:08 +00:00
Jaime Wren 1f4c74dabb Add the new language option in analysis_options.yaml files for enabling the preview-dart-2 flag
Change-Id: I32c090ad1d7696dd18a7db7ee470ea1af5f1ec91
Reviewed-on: https://dart-review.googlesource.com/37921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-31 22:45:08 +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
Jaime Wren 0bca64f57e First draft on API change for support for implicit new and const in the InstanceCreationExpressionImpl class.
Change-Id: Id8df09456689a400957fec15b9f32b8f4f10bab1
Reviewed-on: https://dart-review.googlesource.com/37642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-30 20:07:49 +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