Commit Graph

283 Commits

Author SHA1 Message Date
paulberry@google.com d7c763003d Re-apply "Fix warning in sync_generator1_test.dart"
This re-applies commit 43626, which was reverted in 43628.

What happened: I accidentally tested r43626 against a work-in-progress
build of the Java-based dartanalyzer that contained r43655, so I
failed to update the status files properly.  This resulted in a build
failure, which was addressed by reverting r43626.  Now that r43655 has
landed, the build failure should not occur.

R=hausner@google.com

Review URL: https://codereview.chromium.org//910243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43666 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 20:32:41 +00:00
paulberry@google.com 6ea61b5686 Partial backport of analyzer async/await fixes to Java.
Backport of r43613, r43537, r43446, r43427, r43424, r43418, r43403,
r43361 to the Java-based analyzer.  The backport is partial in that
the TypeProvider was not modified to include Future and Stream types
(this would have required substantial additional effort), and
consequently not all static warnings are correctly produced.  However,
all NonErrorResolverTest cases were successfully backported and pass,
meaning that the Java-based analyzer shouldn't produce false positive
warnings for async/await code anymore.

BUG=dartbug.com/22252
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//913623002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43655 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 16:04:50 +00:00
brianwilkerson@google.com 67889f0c72 Fix the build
R=paulberry@google.com

Review URL: https://codereview.chromium.org//910733003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43606 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 19:07:06 +00:00
hausner@google.com 2487c76886 Add support for sync* and yield and yield*
R=srdjan@google.com

Review URL: https://codereview.chromium.org//888463004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43516 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 18:36:40 +00:00
paulberry@google.com d0b87e247c Implement new "yield*" type checking rules in analyzer.
This updates analyzer to reflect the new static type checking rules
for yield each added in r43420.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//888943004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43446 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 23:13:09 +00:00
paulberry@google.com 2cd86b7e29 Add static type checking of "yield*" statements to analyzer.
This does not include the new static typing rules that were introduced
in revision 43420.  I will address those in a later CL.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//895673005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43424 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 20:32:14 +00:00
paulberry@google.com 5482dcb769 Mark known async test failures in analyzer status file.
These failures are happening because recent async/await improvements
were made only to the Dart-based analysis code, not the Java-based
analysis code.

TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//893793004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43397 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 14:18:43 +00:00
johnniwinther@google.com 801c4e5735 More status updates.
BUG=

Review URL: https://codereview.chromium.org//896663003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43394 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 13:40:24 +00:00
johnniwinther@google.com d9e1bcc91b Support async/await in dart2dart.
BUG=
R=floitsch@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//880973005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43380 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 08:31:54 +00:00
johnniwinther@google.com d0ece3e22f Remove status lines.
BUG=

Review URL: https://codereview.chromium.org//884693002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43234 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 11:51:21 +00:00
johnniwinther@google.com 519263807a Support enums in dart2dart.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//878843003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43230 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 09:04:49 +00:00
whesse@google.com 247ff772d6 Update status files, replace "dartbug.com" with "Issue ".
BUG=
R=ricow@google.com

Review URL: https://codereview.chromium.org//845793004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42900 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 10:27:11 +00:00
sigurdm@google.com bc8a7faf62 Fix status files to allow async-await tests to run on non-vm
Also fix a syntax-error in one test to make the analyzer happy.
BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//847123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42858 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 11:07:35 +00:00
floitsch@google.com 86d9c01cd5 dart2js: Support new const operations on strings.
BUG= http://dartbug.com/21001
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//585173002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42737 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 16:07:53 +00:00
whesse@google.com 28a647be27 Update enum test status for old java analyzer.
BUG=dartbug.com/21649
R=ricow@google.com

Review URL: https://codereview.chromium.org//735273003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41834 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 14:22:49 +00:00
paulberry@google.com 95b485ce90 Add language tests for bugs 21565 and 21566.
R=brianwilkerson@google.com, floitsch@google.com

Review URL: https://codereview.chromium.org//716683002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41670 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 16:52:34 +00:00
paulberry@google.com 3bf0ca6aa8 Fix analyzer's treatment of mixin constructors.
This changes analyzer to match the spec (and the VM behavior) with
regard to which base class constructors are forwarded through mixin
applications: only those constructors that take zero optional
parameters are forwarded.  In addition, the tests in tests/language/
are updated to match analyzer and the VM.

There is one small difference between analyzer and the VM behavior:
the spec says that if no constructors are forwarded at all, then the
mixin application will automatically acquire an implicit default
constructor.  The VM behavior is to issue an error in this
circumstance.  After consulting with Gilad, it seems like the VM
behavior is more consistent with the intent, so I've chosen to make
analyzer and the tests match the VM behavior, in the hopes that the
spec can be changed accordingly.

Should we change our minds in the future and decide that we want to
keep the spec as is, the tests and analyzer behavior can easily be
changed.

BUG=dartbug.com/19576
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//707073002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41645 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 19:28:40 +00:00
brianwilkerson@google.com 750b5e426c Fix issue 19424
R=paulberry@google.com

Review URL: https://codereview.chromium.org//700943003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41526 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 17:05:58 +00:00
paulberry@google.com df62a0d75d Warn when implicit default value overrides explicit one that differs.
BUG=dartbug.com/18914
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//700923002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41503 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 20:32:18 +00:00
paulberry@google.com 18b71fa42a Fix type analysis of the keyword "dynamic".
The type of "dynamic" isn't "dynamic", it's "Type".

BUG=dartbug.com/18731
R=scheglov@google.com

Review URL: https://codereview.chromium.org//680423003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41477 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 04:13:06 +00:00
paulberry@google.com 31c3f90301 Properly implement identical() test in analyzer constant evaluation.
Previously we were treating identical(x, y) as equivalent to (x == y).
However the semantics aren't the same.

BUG=dartbug.com/21177
R=scheglov@google.com

Review URL: https://codereview.chromium.org//689173004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41475 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 01:32:33 +00:00
paulberry@google.com 357d100aba Fix java-based analyzer status for test modifications in r41054.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//665823005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41216 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-20 22:11:36 +00:00
paulberry@google.com 271aee1d83 Handle non-factory redirects in constant evaluation.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//640813004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41169 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 15:54:44 +00:00
paulberry@google.com b4b39a160e Properly annotate type_check_const_function_typedef2_test.
Rather than mark it as "Fail, OK" in the status files, annotate it as
"checked mode compile-time error"; the test framework will convert
this to a pass or fail expectation depending on whether the test is
being run in checked mode.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//632123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40955 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 13:23:42 +00:00
paulberry@google.com cb6243baea Rework EvaluationResultImpl class hierarchy.
This CL changes EvaluationResultImpl from abstract to concrete, and
eliminates its derived classes, ValidResult and ErrorResult.  This
eliminates the dichotomy between "compile time constant that computed
successfully" and "compile time constant that failed to compute
because of errors", so that we can keep track of errors encountered
during successful evaluation of a constant (this is necessary to
support checked mode compile-time errors).  It also avoids the need to
do double dispatch between the two derived classes in order to
evaluate constants involving binary operators.

We now keep track of constant evaluation errors my accumulating them
into a list (which is passed as a constructor argument into
ConstantVisitor).  This allows ConstantVisitor to represent its
intermediate values using DartObjectImpl directly, and fixes some
corner cases where we were dropping or duplicating constant evaluation
errors.

As a result of fixing the corner cases, issue 21177 is exposed.
(Previously the test "compile_time_constant10_test/none" failed to
show the bug due to the error being dropped).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//613303003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40856 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 21:21:11 +00:00
paulberry@google.com f01af1652d Support more checked mode compile time errors in analysis engine.
This changes the following errors to be checked mode compile time errors:

- LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
- MAP_VALUE_TYPE_NOT_ASSIGNABLE
- MAP_KEY_TYPE_NOT_ASSIGNABLE

It also ensures that static warnings are always generated, so if the
analysis engine's client decides to disregard checked mode compile
time errors, the warnings won't be lost.

BUG=dartbug.com/16391
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//613673006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40790 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 21:42:09 +00:00
paulberry@google.com 7efd38d195 Start implementing checked mode compile time errors in analyzer.
This enables the Java-based command-line analyzer to accept the
"--enable_type_checks" flag so that it can be told whether to report
type checking errors during constant evaluation.  Also it fixes the
tests language/compile_time_constant_checked2_test and
language/compile_time_constant_checked3_test in unchecked mode, by
causing CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE to be escalated to an
error only in checked mode.

Note: in order to test this properly, I had to remove a hack from
test_runner.dart which caused it to effectively ignore the "checked
mode compile-time error" test annotation when testing analyzer.  With
this hack removed, several new lines needed to be added to the .status
files.

BUG=dartbug.com/16391
R=jwren@google.com, kustermann@google.com

Review URL: https://codereview.chromium.org//610863004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40780 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 18:59:14 +00:00
johnniwinther@google.com 02bc6381e4 Revert "Handle implicitly hidden exports."
This reverts commit r40310.

BUG=

Review URL: https://codereview.chromium.org//572153003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40313 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 12:17:28 +00:00
johnniwinther@google.com b2e1412851 Handle implicitly hidden exports.
BUG=http://dartbug.com/20935
R=karlklose@google.com

Review URL: https://codereview.chromium.org//564403002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40310 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 11:13:56 +00:00
sigurdm@google.com 457c8c33c7 Remove support for the DeferredLibrary annotation and remove tests of it
BUG= 18562
R=floitsch@google.com, hausner@google.com

Review URL: https://codereview.chromium.org//429883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39797 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 08:34:34 +00:00
hausner@google.com 6e637eb27f Initializing a final instance is a runtime error
If a final instance variable is initialized at the point of declaration, it
is a runtime error if it is initialized again in a constructor’s initializer
list or by an initializing formal.

If any instance field is initialized more than once in the initializer list of
a constructor, or by an initializing formal parameter, it is a compile time
error.

Adding a new test to cover the expected runtime error.

Fixes issue 13335.

R=regis@google.com

Review URL: https://codereview.chromium.org//505033002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39562 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 19:37:36 +00:00
johnniwinther@google.com 0054dcae58 Add regression test for issue 20074.
Issue solved for dart2js in r38847.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//437813003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38860 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 14:31:00 +00:00
scheglov@google.com a4dee8bf4c Resolve names in combinators for PropertyInducingElements instead of PropertyAccessorElements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//384093002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38199 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 17:11:34 +00:00
fschneider@google.com 8b1319ab8a Fix analyzer status after my previous CL.
The test I added is expected to produce warnings because it tests
invalid noSuchMethod overriding.

TBR=iposva@google.com

Review URL: https://codereview.chromium.org//384393002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38186 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 11:16:17 +00:00
paulberry@google.com f825cc7389 Generate compile errors for illegal uses of const Symbol constructor.
BUG=dartbug.com/18755
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//387003003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38163 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-11 18:12:03 +00:00
johnniwinther@google.com 25115a67e4 Fix analyzer status again.
BUG=

Review URL: https://codereview.chromium.org//338513004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37314 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 13:19:30 +00:00
johnniwinther@google.com 0ea92b90b4 Update analyzer status.
BUG=

Review URL: https://codereview.chromium.org//330803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37313 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 12:59:30 +00:00
iposva@google.com ab18821876 - Fix the external_test.dart as it was relying on outdated
functionality and broken syntax. So some tests were passing
  for the wrong reason.
- Fix the VM parser to properly report the compilation errors.
- Fix the generation of pretty names of private identifiers.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//269253007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37208 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 22:19:33 +00:00
paulberry@google.com 2c4bba8522 Generate proper override warnings when conflicting members are inherited.
BUG=dartbug.com/16135 dartbug.com/17983
R=jwren@google.com

Review URL: https://codereview.chromium.org//296193008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36690 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 15:57:31 +00:00
paulberry@google.com 086a6aee39 Get rid of unnecessary flaky annotation
Issue 16498 was fixed in February, so we should be able to run these
tests normally now.

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

Review URL: https://codereview.chromium.org//290173009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36519 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 18:16:11 +00:00
brianwilkerson@google.com 5d7cf18eb4 Fix for issue 17476
R=jwren@google.com

Review URL: https://codereview.chromium.org//296903003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36441 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 17:20:26 +00:00
brianwilkerson@google.com 2b4968e242 Fix for issue 14527
R=scheglov@google.com

Review URL: https://codereview.chromium.org//296043003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36371 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 18:19:14 +00:00
jwren@google.com 94dc67f9b5 Fix for analyzer, 18562, warning for deferred types is now generated on type tests, casts and catch clauses.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//283213002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36223 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-15 14:51:36 +00:00
brianwilkerson@google.com c217bd1284 Fix for issue 16423
R=scheglov@google.com

Review URL: https://codereview.chromium.org//280873002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36127 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-13 20:37:03 +00:00
brianwilkerson@google.com ed77fdec57 Triage some failing tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//276893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35975 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 15:29:42 +00:00
paulberry@google.com 5e0f96f201 Evaluate constant instance creation expressions in ConstantValueComputer.
Previously, we evaluated them in ConstantVisitor; as a result we
couldn't take advantage of the ConstantValueComputer's depedendency
graph, so we couldn't detect cycles involving constant constructor
declarations.  This will become important soon, when we expand our
constant evaluation logic to traverse constructor field initializers.

With this change, ConstantValueComputer stores the computed value of
each constant instance creation expression in the AST (similar to how
it stores the computed value of each constant variable in the element
model), and ConstantVisitor simply looks up the already-computed
value.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//270813004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35969 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 12:51:25 +00:00
scheglov@google.com 86d01fb53a Issue 18653. Report error for a const constructor in a class with a mixin.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18653

Review URL: https://codereview.chromium.org//272803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35953 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 23:21:36 +00:00
johnniwinther@google.com dc0bd5cd50 Fix test.
BUG=http://dartbug.com/18700
R=karlklose@google.com

Review URL: https://codereview.chromium.org//270633010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35899 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 10:30:37 +00:00
scheglov@google.com 210407ed4a Issue 16672. Report warning for assignment to a function.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=16672

Review URL: https://codereview.chromium.org//272683002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35869 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-07 21:29:17 +00:00
scheglov@google.com ebb2c951cb Issue 16314. Skip leading UTF-8 BOM.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=16314

Review URL: https://codereview.chromium.org//270573007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35867 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-07 20:35:34 +00:00