Commit Graph

4276 Commits

Author SHA1 Message Date
Dan Rubel d21d8ef0cb report abstract class member as separate error code
Anytime a user adds `abstract` to a member of a class,
the fasta parser now reports an AbstractClassMember error
rather than the more general ExtraneousModifier error.

Change-Id: I41094ff71d38f1572c692b0a66fe8b68948fc23b
Reviewed-on: https://dart-review.googlesource.com/4143
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-07 20:58:44 +00:00
Sigmund Cherem 436ed70100 Add preview-dart-2 flag to analyzer cli and plumb it through test.py.
This allows us to collect stats about language-style tests as follows:

 ./tools/test.py -m release -c dart2analyzer -r none --preview-dart-2 --report \
      language language_2 corelib corelib_2

As of this morning, the command above has 87% of the tests passing.

Change-Id: I0f84211d5f33659d5923601267367be90c578107
Reviewed-on: https://dart-review.googlesource.com/3381
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-07 20:13:40 +00:00
Konstantin Shcheglov 1b4239d2e4 Export ByteStore and its implementations from front_end.
R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Ie2e3413a7f143e270cec2bd3ae4564ad7cc315b1
Reviewed-on: https://dart-review.googlesource.com/3840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-09-07 19:23:21 +00:00
Dan Rubel ec606a7874 report ExternalMethodWithBody error for native method with body
Change-Id: Ibca0cd1223ee61cafd2427d26448a1890a04aae8
Reviewed-on: https://dart-review.googlesource.com/3560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-09-07 11:03:45 +00:00
Lasse Reichstein Holst Nielsen 76a3b431bb Revert "Create new style GenericFunctionTypeElementImpl for function typed parameters."
This CL broke the SDK API-doc generation.
See https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fclient.dart%2Fdart-sdk-linux-be%2F15242%2F%2B%2Frecipes%2Fsteps%2Fgenerate_API_docs%2F0%2Fstdout

Change-Id: I2b4acd766fb65e82a29b73412833e04112ba9dc4
Reviewed-on: https://dart-review.googlesource.com/3460
Reviewed-by: Jonas Termansen <sortie@google.com>
2017-09-06 10:43:11 +00:00
Konstantin Shcheglov a3f8740bbd Create new style GenericFunctionTypeElementImpl for function typed parameters.
ParameterElement.parameters/typeParameters always return empty lists.

R=brianwilkerson@google.com

Bug:
Change-Id: I5200df9e891031437d6e597f30fa54399b7d00e1
Reviewed-on: https://dart-review.googlesource.com/3401
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-06 02:31:11 +00:00
Konstantin Shcheglov 455984bbf9 Fix fuzzy arrow warnings in analyzer and analysis_server.
There is one warning which I'd like to fix in a separate CL.

The rest is because of package:test predicate().
I think Leaf fixed it in https://github.com/dart-lang/matcher/commit/3625f13698346576da0f5baf44e95abc9c56fb49


R=brianwilkerson@google.com

Bug:
Change-Id: I060f7ced55dbcc460185916251c47ebbd5c838d3
Reviewed-on: https://dart-review.googlesource.com/3404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-06 00:26:18 +00:00
Jennifer Messerly 0d8d1af67f fix #30601, covariant checks for bounds were not working in some cases
This has a few related fixes:

fix #30461, DDC now generates covariant checks for superclasses with the correct substitution.

fix #29483, Analyzer can resolve the function type literal syntax correctly when used in type bounds and type arguments.

fix #30095, replace use of DDC's StrongModeError private type with TypeError.

It also has some refactoring to simplify how DDC emits the initialization code at the start of function/method bodies. We no longer jump through AST parent pointers.

Change-Id: I7001f98cd0e00299d77bace49e19aca305abf224
Reviewed-on: https://dart-review.googlesource.com/3100
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-09-05 22:44:19 +00:00
Brian Wilkerson 8aa6a328e5 Enable asserts in initializer lists
Change-Id: I94e3797625dfb2ec5a49225dc1f0984f1ae3fbd8
Reviewed-on: https://dart-review.googlesource.com/3300
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-09-05 17:14:06 +00:00
Dan Rubel 7733322d79 report const class as a more specific error code
This depends upon https://codereview.chromium.org/3007943002/ landing first.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3007033002 .
2017-09-02 08:46:35 -04:00
Brian Wilkerson e8b0a7cbf9 Revert earlier changes to fix bots (TBR)
Review-Url: https://codereview.chromium.org/3010913002 .
2017-09-01 10:43:13 -07:00
Terry Lucas 0585e74b63 Fixed analyzer test to use dart2js not dartium
R=paulberry@google.com

Committed: https://github.com/dart-lang/sdk/commit/704de3bb3e27313c0eb6eb5ebc03173a5396dd1e
Review-Url: https://codereview.chromium.org/3004153002 .
2017-09-01 09:03:16 -07:00
Brian Wilkerson 47162b9174 Fix and triage more tests
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/3005973002 .
2017-09-01 07:52:05 -07:00
William Hesse a8cab7a205 Revert "Removed Dartium SDK libs"
This reverts commit 4a58918382.
That commit seems to have broken docgen on the html libraries.

BUG=
TBR=terry@google.com

Review-Url: https://codereview.chromium.org/3004173002 .
2017-09-01 00:47:57 +02:00
Konstantin Shcheglov d1988c9c7f Fix for using enums as InterfaceType(s) when resynthesize from Kernel.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3006983002 .
2017-08-31 14:06:48 -07:00
Konstantin Shcheglov 5e67987ecb Don't treat typedef-typed formal parameters as funtion-type from resynthesize from Kernel.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3004163002 .
2017-08-31 13:59:24 -07:00
Leaf Petersen eb53858ad6 Inheritance manager fix for fuzzy arrows
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3006643002 .
2017-08-31 12:59:36 -07:00
Konstantin Shcheglov b617cde778 Resynthesize references to type parameters in default expressions from Kernel.
Update the related tests to take into account the fact that front-end
infers type arguments, but the summaries linker does not.

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

Review-Url: https://codereview.chromium.org/3009933002 .
2017-08-31 12:37:26 -07:00
Leaf Petersen 1c94f7a604 Reland and refactor fuzzy arrow hints.
This restores the functionality from https://codereview.chromium.org/3012593002/, with some small refactors.

The test breakage that caused the revert is fixed in https://codereview.chromium.org/3004143002/ .

Also adds a couple of drive by fuzzy arrow fixes.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3006893002 .
2017-08-31 12:18:51 -07:00
Konstantin Shcheglov d704073f40 Resynthesize ?? expressions from Kernel.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3006973002 .
2017-08-31 12:18:22 -07:00
Brian Wilkerson 2ee7750f8a Mark unsafe token access in AstBuilder
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/3012663002 .
2017-08-31 10:29:57 -07:00
Terry Lucas 4a58918382 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Committed: https://github.com/dart-lang/sdk/commit/d96561af083777ac9529c75ae05b6e89f8f06a6c
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-31 07:17:23 -07:00
Brian Wilkerson 6c67db11cf Fix more of the Fasta tests
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/3004103002 .
2017-08-31 06:34:55 -07:00
Karl Klose d7a6ef9f64 Revert "Add a hint on static uses of fuzzy arrows."
This reverts commit 1f7c0d2c4c.

TBR=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004113002 .
2017-08-31 08:30:22 +02:00
Terry Lucas f1269525a8 Revert: Removed Dartium SDK libs
Review-Url: https://codereview.chromium.org/3005913003 .
2017-08-30 20:47:07 -07:00
Terry Lucas d96561af08 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-30 20:07:15 -07:00
Leaf Petersen 1f7c0d2c4c Add a hint on static uses of fuzzy arrows.
This causes the analyzer to emit a hint message when fuzzy arrow
subtyping is used.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3012593002 .
2017-08-30 15:27:26 -07:00
pq 9efd55d531 Ensure mustCallSuper check visits children (flutter#11646).
R=brianwilkerson@google.com

Fixes:  https://github.com/flutter/flutter/issues/11646
Review-Url: https://codereview.chromium.org/3007873002 .
2017-08-30 13:43:36 -07:00
Brian Wilkerson 6a48eff924 Fix several failing tests
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/3011643002 .
2017-08-30 11:04:08 -07:00
Terry Lucas 05ca90aa8c Removed Dartium test exceptions
R=alanknight@google.com

Committed: https://github.com/dart-lang/sdk/commit/84f079f24c75aec51a53c17f1ebe0027b2adbb0c
Review-Url: https://codereview.chromium.org/2983033002 .
2017-08-29 07:15:06 -07:00
Terry Lucas a18908461a Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com

Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-29 06:38:53 -07:00
Dan Rubel 2d449c870f flatten token hierarchy
This merges functionality and removes several Token classes
making the Token hierarchy more compact.

* merge BeginTokenWithComment into BeginToken
* merge KeywordTokenWithComment into KeywordToken
* merge StringTokenWithComment into StringToken
* merge TokenWithComment into SimpleToken

R=ahe@google.com

Review-Url: https://codereview.chromium.org/3010533002 .
2017-08-29 08:59:16 -04:00
Konstantin Shcheglov ffe382aca2 Remove unused method from LibraryContext, use ElementResynthesizer directly.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/3006663002 .
2017-08-26 07:56:54 -07:00
Konstantin Shcheglov f5422e5998 Fixes for AnalysisDriver async CL comments.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3003923002 .
2017-08-25 14:56:43 -07:00
Konstantin Shcheglov 4b7e81230f Clean up comments for AnalysisDriver results.
Don't reference removed [contentHash].

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2998423002 .
2017-08-25 14:54:52 -07:00
Konstantin Shcheglov 5586741d92 Work around breaking task_dependency_graph/check_test because of a bug in AnalysisContext with generalized functions.
This fixes breaking after https://codereview.chromium.org/3010463002

TBR

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

Review-Url: https://codereview.chromium.org/3006653002 .
2017-08-25 14:47:44 -07:00
Konstantin Shcheglov 1d5de7ffd5 Make creating LibraryContext async, so all its transitive clients.
This prepare us for resynthesizing element model from Kernel, because
KernelDriver is async, because everything in front-end is async.

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

Review-Url: https://codereview.chromium.org/3010463002 .
2017-08-25 12:52:12 -07:00
Konstantin Shcheglov ea23fc8bf3 Implement Mutex for Dart.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3006563003 .
2017-08-25 10:21:41 -07:00
Dan Rubel 8786656783 map fasta error codes to analyzer
Rather than have multple fine grained error codes for each type
of modifier in each situation, this CL adds a new analyzer
ParserErrorCode.EXTRANEOUS_MODIFIER parallel to the fast parser
error code and updates the AstBuilder to generate that error
rather than ParserErrorCode.ABSTRACT_CLASS_MEMBER.

My goal is to review each analyzer error code similar to
ParserErrorCode.ABSTRACT_CLASS_MEMBER and map each to the same
ParserErrorCode.EXTRANEOUS_MODIFIER error code.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2999303002 .
2017-08-25 09:00:18 -04:00
Konstantin Shcheglov 556b0284b3 Report compile time errors when assert initializers fail.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3003363002 .
2017-08-24 14:48:15 -07:00
Konstantin Shcheglov 3d7d829e45 Build / resynthesize final fields as ConstFieldElementImpl only if the enclosing class has a constant constructor.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/3008453002 .
2017-08-24 10:01:47 -07:00
Konstantin Shcheglov 827075befb Store the covariant keyword flag for parameters and fields into Kernel and resynthesize in analyzer.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3008463002 .
2017-08-24 07:17:36 -07:00
Konstantin Shcheglov dab5318fad Clear StringToken.canonicalizer after each parsing.
Otherwise the canonicalizer grows without limit, and if the user
edits files, we constantly parse new strings, so constantly add new
entries into the cananonicalizer. Basically, it is not friendly for
long running processes. I'm not quite sure why we need to makes it
static anyway, if it can be used only for the same file content. Once
we're done with a file, that is it, we don't need its entries.

Anyway, this fixes a leak in Analysis Server.

R=ahe@google.com, brianwilkerson@google.com, danrubel@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3003753002 .
2017-08-23 10:57:27 -07:00
Konstantin Shcheglov 46f0940a0a Resynthesize assert constructor initializers and parameter references.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3002633002 .
2017-08-23 10:06:49 -07:00
Konstantin Shcheglov 936569da6d Add implicit dart:core import when resynthsize from Kernel.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/3000913002 .
2017-08-23 09:50:25 -07:00
Dan Rubel 69e9106ead improve fasta export directive recovery
R=ahe@google.com

Review-Url: https://codereview.chromium.org/3001993002 .
2017-08-22 16:52:23 -04:00
Brian Wilkerson 8f0b996264 Ignore missing error codes, but report them
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3002123002 .
2017-08-22 09:59:39 -07:00
Brian Wilkerson 3e260f3e76 Remove support for watching changes to the set of files known to a driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2996383002 .
2017-08-22 09:06:56 -07:00
Dan Rubel d1385f099f support class native clause
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2996163002 .
2017-08-22 07:42:56 -04:00
Brian Wilkerson 7afa1e2986 Deprecate MethodElement.getReifiedType
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2997333002 .
2017-08-21 16:21:43 -07:00