Commit Graph

55 Commits

Author SHA1 Message Date
Erik Ernst 9336e199fd Re-land of CL 2990703002, adding fixes to analyzer_test and error_test.
This CL is identical to the reverted CL 2990703002 which implements
syntactic support for generalized void in the analyzer, plus two bug
fixes in pkg/analyzer/test/generated/parser_test.dart and
pkg/analyzer_cli/test/error_test.dart. In the former, a test on parsing
`void,` was changed to expect an error: _isTypeIdentifier on a lone
`void` will no longer return true, which is necessary because `void`
can now be used as a type annotation alone. Another test on `void x`
was added, which produces the behavior previously seen for `void,`.
In error_test, the error which is used throughout was changed from
`void foo;` to `var int foo;` (because the former is no longer an
error).

Review-Url: https://codereview.chromium.org/2992623002 .
2017-07-27 12:39:19 +02:00
Erik Ernst 2e73ce1187 Revert "Implemented support for generalized void in analyzer."
This reverts commit 1d44f5296a,
because it causes failures for the analyzer in parser_test, error_test.

Review-Url: https://codereview.chromium.org/2990723002 .
2017-07-26 18:18:04 +02:00
Erik Ernst 1d44f5296a Implemented support for generalized void in analyzer.
Changed the analyzer parser to accept usages of `void` which were
previously rejected as syntax errors: `void` can now be the type
annotation for a variable or parameter, and it can be an actual type
argument.

Removed affected error codes like VOID_PARAMETER, VOID_VARIABLE,
VOID_RETURN_FOR_GETTER and associated declarations (like checking
functions), and adjusted test cases to expect success rather than
compile time errors.

Adjusted generalized_void_syntax_test.dart (it had real errors like
`final` variables with no initializer etc. that were not detected
when tools would just reject the file as syntactically wrong).

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2990703002 .
2017-07-26 17:45:13 +02:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Jennifer Messerly 613881a433 fix #29426, class type alias was missing checks
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2837173002 .
2017-04-24 15:02:29 -07:00
Brian Wilkerson 3dcf0e31c5 Split error code to ease future improvements
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2813553006 .
2017-04-11 13:35:38 -07:00
Leaf Petersen e40f878abc Restore weak mode errors on empty returns in Null functions.
Fixes https://github.com/dart-lang/sdk/issues/28668 .

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2752423003 .
2017-03-17 14:30:42 -07:00
Konstantin Shcheglov 4cd790abe3 Record isFinal for parameters into summaries.
Found this out while running shared tests with the new analysis driver.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657583007 .
2017-01-25 15:08:37 -08:00
Konstantin Shcheglov b8ab9b7e17 Fix tests to run with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2656783002 .
2017-01-25 06:58:24 -08:00
Konstantin Shcheglov 9d240f8fb1 Replace reset() arguments with resetWith() invocation.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2627083003 .
2017-01-11 13:37:22 -08:00
Konstantin Shcheglov 799296e92b Extract x_Driver tests that time out on Windows bots.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2623253003 .
2017-01-11 11:49:34 -08:00
Konstantin Shcheglov 73e7da4976 Run the most of error generating tests with the new analysis driver.
Some tests have more failures than I feel comfortable marking as failing.
I will triage them in following CLs.

StaticTypeAnalyzer2Test
StrictModeTest
StrongModeDownwardsInferenceTest
StrongModeStaticTypeAnalyzer2Test
TypePropagationTest

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628743002 .
2017-01-11 08:25:21 -08:00
Konstantin Shcheglov 65ff5b5e50 Explicitly compute analysis results for sources to check errors.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625783002 .
2017-01-10 12:58:58 -08:00
Konstantin Shcheglov 5a3afed30f Make error producing tests ansynchronous.
This is another preliminary test to run these tests with the new
analysis driver. Especially when we're going to replace the task based
analysis implementation with another one.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2624793002 .
2017-01-10 10:33:44 -08:00
Konstantin Shcheglov b5c5c1c222 Remove computeLibrarySourceErrors().
All errors are computed and validated in assertErrors().

In a 3 tests assertErrors() for the library was mved before the call
for a part to ensure library/part link establishment.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2626653002 .
2017-01-10 08:44:48 -08:00
Brian Wilkerson a3e1a0d395 Enable generic method support by default
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2488043002 .
2016-11-22 09:16:19 -08:00
Brian Wilkerson 6ce2f220e3 Add an error when a type parameter from a generic function is used in an is test
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2479293004 .
2016-11-09 07:47:54 -08:00
Konstantin Shcheglov 5455fd0118 Remove 'initializeTestEnvironment' from 'analyzer'.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2399913002 .
2016-10-06 10:18:54 -07:00
Konstantin Shcheglov 175dad4f15 Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2391423003 .
2016-10-06 08:46:35 -07:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Konstantin Shcheglov cc6beaf56d Pull in test_reflective_loader 0.0.4 and switch analyzer to it.
There are following changes:

1. DEPS to pull in test_reflective_loader 0.0.4
2. Rename runReflectiveTests() to defineReflectiveTests().
3. Remove analyzer's pkg/analyzer/test/reflective_tests.dart
4. Replace reflective_tests.dart imports with package:test_reflective_loader/test_reflective_loader.dart imports.
5. Sort/format and organize imports in the files with imports changes.
6. Fix for a couple of bugs in analysis_server exposed by the new loader.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2298913003 .
2016-08-31 13:46:39 -07:00
Sam Rawlins e60c1e4c59 Add an UNDEFINED_IDENTIFIER_AWAIT warning
BUG=https://github.com/dart-lang/sdk/issues/22625
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2156003004 .
2016-07-18 09:45:36 -07:00
Brian Wilkerson 8c244f03ad Report when members indirectly inherited through a mixin are not implemented (issue 26411)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951363003 .
2016-05-06 11:29:44 -07:00
Brian Wilkerson 974385bb48 Add a failing test for generic tear-offs
R=leafp@google.com

Review URL: https://codereview.chromium.org/1933783002 .
2016-04-29 10:10:10 -07:00
Brian Wilkerson deae702994 Format everything in analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842563003 .
2016-03-28 18:16:43 -07:00
Brian Wilkerson 513433d514 Sort analyzer sources
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1843473002 .
2016-03-28 17:41:52 -07:00
Bob Nystrom 8defa5f77c Split resolver_test.dart into smaller files.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1782463002 .
2016-03-09 10:42:09 -08:00
Bob Nystrom 4af641864f A missing enum case in a switch is a warning, not a compile-time error.
Fixes #25576.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1644683002 .
2016-01-28 11:12:25 -08:00
Brian Wilkerson f0d249e269 Clean up package imports and library names
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1513643009 .
2015-12-10 08:11:56 -08:00
Brian Wilkerson cc8f64b824 Do not generate warnings when noSuchMethod is inherited (issue 24337)
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1414003003 .
2015-10-20 10:35:53 -07:00
pq 67e988bb9f No more warnings for duplicate unnamed lib imports
Fixes #24156.

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

Review URL: https://codereview.chromium.org//1305433005 .
2015-08-20 14:30:37 -07:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
Konstantin Shcheglov 96670b0e97 Fix for explicit dart:core import.
This fixes the rest of the co19/ tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1181663004.
2015-06-12 13:26:12 -07:00
Konstantin Shcheglov 9634a03393 Explicitly compute library errors in tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183723002.
2015-06-12 12:28:24 -07:00
Paul Berry fc83ce5ba9 Fix analyzer's handling of import prefixes not followed by '.'.
If 'p' is an import prefix, then 'p = ...' is treated as synonymous
with 'this.p = ...', and 'p()' is treated as synonymous with
'this.p()'.  In all other circumstances where 'p' is not followed by
'.', the spec calls for a compile time error.

Previous to this CL, 'p' not followed by '.' was being treated as
synonymous with 'this.p' under all circumstances.  This CL brings
analyzer in line with the spec, and updates the tests in
tests/language accordingly.

The VM and Dart2js currently fail to implement the compile-time error
properly.  See issues #23611 and #23612.

Fixes issue #23461.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1173523002.
2015-06-09 13:38:53 -07:00
paulberry@google.com 5677e52ad6 Generate warnings for assignment to a type.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44774 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 00:08:17 +00:00
scheglov@google.com ef2a41217d Add NOT_INITIALIZED_FIELDS property for FINAL_NOT_INITIALIZED_CONSTRUCTOR_X.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44511 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-16 17:49:19 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
paulberry@google.com b40a5702b3 Fix async/await type checking in analyzer.
This required making the "async" library into TypeProvider so that we
can create Future<...> types when doing resolution and error/hint
checking.

BUG=21888,22053,22091,22092,22160,22164
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43361 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 20:58:37 +00:00
danrubel@google.com d284fef9db cleanup unused imports
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43086 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 22:41:51 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00
brianwilkerson@google.com dd306dc9eb Enable enum and deferred import support
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42704 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-08 17:51:49 +00:00
paulberry@google.com 7cd5226565 Annotate remaining analyzer/analysis server tests with "@ReflectiveTestCase()"
In r42181, I failed to notice the need to annotate these tests because
they aren't currently being run under dart2js (most likely due to
slowness).  I've modified runReflectiveTests() to check for the
presence of the annotation before running the tests, in order to
ensure that all the classes are properly annotated now, and so that we
won't forget to add annotations in the future.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42185 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 21:35:52 +00:00
brianwilkerson@google.com ff7f0f4bd4 Fix for issue 20930
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41970 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 20:51:36 +00:00
scheglov@google.com b8da9bc651 Format and sort analyzer and analysis_server packages.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41792 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 22:23:53 +00:00
brianwilkerson@google.com ec7979a9a2 Fix for issue 20125 - improved error messages
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41613 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 19:29:12 +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 e18464b912 Always check if instance method name collides with superclass static.
Previously we only did this check if nothing was overridden.
Persumably that was intended as a speed optimization, since at first
glance it would seem that if the instance method overrides something,
then it can't possibly conflict with a static method in the
superclass.  However, that optimization doesn't work if the method
being overridden is in an interface (in that case the superclass can
still have a static method with the same name).  So just go ahead and
check in all cases.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41501 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 19:31:31 +00:00