Commit Graph

41 Commits

Author SHA1 Message Date
Konstantin Shcheglov 19353f9e63 Issue 29358. Fix for reporting constant errors while evaluating constructor invocations.
We should not report errors in one file using offsets of node in
another file.

R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/29358

Review-Url: https://codereview.chromium.org/2825813002 .
2017-04-18 12:13:23 -07:00
Konstantin Shcheglov 62320cc838 Issue 25558. Report an error, but don't crash when AST it too deep.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25558

Review-Url: https://codereview.chromium.org/2823993002 .
2017-04-17 14:46:55 -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
Konstantin Shcheglov 9b701ae3da Add ParserErrorCode.INVALID_CONSTRUCTOR_NAME to the list of all error codes.
We need this for AnalysisDriver to be able to deserialize this error.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2780833002 .
2017-03-28 10:30:59 -07:00
Konstantin Shcheglov 27ab6478b9 Report errors for the new top-level inference rules.
We also stop type inference most of these cases with task based analysis.
Summary based analysis is not changed yet.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2782533002 .
2017-03-28 09:41:04 -07:00
Brian Wilkerson 4f28d97ac2 Add error checking for the immutable annotation (issue 27750)
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2775863004 .
2017-03-24 11:56:24 -07:00
Brian Wilkerson ccf768144f More generic function type cases working
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2770143002 .
2017-03-24 08:08:23 -07:00
Brian Wilkerson 97cc40e0a7 Add strong mode error for mixins defining conflicting private names (issue 28809)
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2738113002 .
2017-03-22 08:42:30 -07:00
Konstantin Shcheglov 571aae42b8 Issue 25733. Built-in itentifiers are not permitted as prefixes.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25733

Review-Url: https://codereview.chromium.org/2735193002 .
2017-03-07 10:16:45 -08:00
Brian Wilkerson 44148ec0a4 Revert "Add error for mixins defining conflicting private names (issue 28809)"
Review-Url: https://codereview.chromium.org/2716133002 .
2017-02-25 07:50:42 -08:00
Brian Wilkerson 12b6f249f3 Add error for mixins defining conflicting private names (issue 28809)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2716453006 .
2017-02-25 07:27:58 -08:00
Konstantin Shcheglov 94556d578d Remove AnalysisErrorWithProperties and ErrorProperty.
It was not used in Analysis Server for some time, and we cannot use
it for any practical purpose with the new analysis driver.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2706123002 .
2017-02-20 15:13:42 -08:00
Brian Wilkerson 1bd630f4a2 Fix stack overflow printing recursive function types (issue 28835)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2707983002 .
2017-02-20 11:37:08 -08:00
Paul Berry c9b692e8d9 Add a temporary analyzer error to work around #28515
Analyzer summaries do not yet support generic function-typed
parameters.  To avoid user confusion, generate an error if the user
tries to use a generic function-typed parameter.

The error can be worked around by using a typedef or changing generic
types to `dynamic`.

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

Review-Url: https://codereview.chromium.org/2656303004 .
2017-01-29 07:35:03 -08:00
Konstantin Shcheglov 919d70d0cb Issue 28100. Implement new strong mode instantiate to bound rules in analyzer.
R=leafp@google.com, brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28100

Review-Url: https://codereview.chromium.org/2640143007 .
2017-01-23 10:12:32 -08:00
Florian Loitsch 9a0ccfc092 Deprecate the use of Function as a class.
Shows a hint when `Function` is used:
- as a class name,
- in an extends clause,
- in a with clause.

The `Function` may or may not point to the core's `Function`. All uses of `Function` in these contexts are deprecated.

R=brianwilkerson@google.com

Committed: https://github.com/dart-lang/sdk/commit/4e6e72b0b0bc1558ea0ba695363c6dc8bf9433f5

Reverted: https://github.com/dart-lang/sdk/commit/3f871ae76f5269b50e531c61038727a074301990
Review-Url: https://codereview.chromium.org/2643073002 .
2017-01-23 17:34:09 +01:00
Florian Loitsch 5616882833 Revert "Deprecate the use of Function as a class."
This reverts commit 4e6e72b0b0.

BUG=

Review-Url: https://codereview.chromium.org/2650763002 .
2017-01-23 17:09:16 +01:00
Florian Loitsch 4e6e72b0b0 Deprecate the use of Function as a class.
Shows a hint when `Function` is used:
- as a class name,
- in an extends clause,
- in an implements clause,
- in a with clause.

The `Function` may or may not point to the core's `Function`. All uses of `Function` in these contexts are deprecated.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2643073002 .
2017-01-23 16:39:04 +01:00
Brian Wilkerson c40ec27266 Get the rest of the shared tests for covariant to pass
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2642683006 .
2017-01-20 15:04:50 -08:00
Brian Wilkerson fba8298923 Add missed error code
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2641383002 .
2017-01-20 10:58:35 -08:00
Konstantin Shcheglov c7487dfaea Issue 28100. In strong mode verify that TypeParameter bound has required type arguments.
R=brianwilkerson@google.com, leafp@google.com
BUG= https://github.com/dart-lang/sdk/issues/28100

Review-Url: https://codereview.chromium.org/2641213002 .
2017-01-19 13:25:48 -08:00
Brian Wilkerson d06a2326f1 Add parser support for covariant parameters
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2639883005 .
2017-01-19 09:38:35 -08:00
Brian Wilkerson e7577172d1 Add preliminary parser support for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2628973003 .
2017-01-12 07:00:24 -08:00
Konstantin Shcheglov 0377beb128 Update 'Add final field formal parameters' Quick Fix to support the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2618923003 .
2017-01-06 14:34:49 -08:00
Brian Wilkerson e22a2b4626 Enable messages in asserts by default
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2557513008 .
2016-12-07 12:23:00 -08:00
Brian Wilkerson 13933e9363 Add another missing error code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2553443002 .
2016-12-04 16:03:08 -08:00
Konstantin Shcheglov 6f98b89877 Add ResolverErrorCode to errorCodeValues.
It might be these codes that caused the failure worked around in https://github.com/dart-lang/sdk/commit/5ff8db3a5f75b699ead93a9ffdb8998b9608c505

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

Review URL: https://codereview.chromium.org/2544883007 .
2016-12-03 13:59:30 -08:00
Konstantin Shcheglov c3e2c45cb3 Extract 'computeMissingOverrides' in ErrorVerifier.
So, we can reuse it in Quick Fixes.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2541153002 .
2016-11-30 14:04:43 -08:00
Paul Berry 0c928771fc Revert "Connect analyzer's AnalysisError object to front_end's CompilationError."
This reverts commit fc5270df72.

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

Review URL: https://codereview.chromium.org/2503803003 .
2016-11-15 10:00:34 -08:00
Paul Berry fc5270df72 Connect analyzer's AnalysisError object to front_end's CompilationError.
AnalysisError implements CompilationError but provides additional
services, such as extensibility via the `getProperty` method.

Note: CompilationError.location has been renamed to
CompilationError.span to avoid confusion (since its type is
`SourceSpan`, not `SourceLocation`).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2498133002 .
2016-11-14 15:30:10 -08:00
Paul Berry 4cd9b28eb6 Create pkg/front_end/src/base and begin populating with general use classes.
In the long run, pkg/front_end/src/base is intended to contain code
that is useful to many components of the front end.

In this initial implementation, it contains:
- Source and the classes it references
- ErrorCode, ErrorSeverity, and ErrorType
- SyntacticEntity

Note that AnalysisTarget is included (even though strictly speaking it
is part of the analyzer task model) because it was too hard to
disentangle from Source.

Note that Token classes remain in pkg/front_end/src/scanner for now; I
plan to reorganize them at the time the parser is moved into the front
end.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2486923007 .
2016-11-14 09:20:18 -08:00
Paul Berry 0a1fb8d248 Move scanner into pkg/front_end/lib/src/scanner.
Several support classes also had to move to front_end along with the
scanner.  Some of these support classes arguably don't belong to the
scanner itself, since they have other uses (e.g. SyntacticEntity,
ErrorCode, ErrorSeverity, ErrorType, and StringUtilities).  They will
be reorganized into a more appropriate location in future CLs, at the
time that they become needed by other components of the front end.

In order to avoid dragging in a lot of dependencies, the following
changes were made:

1. Scanner no longer reports errors through Source and
AnalysisErrorListener objects passed to the constructor.  Instead, it
provides an abstract reportError() method which clients may override
to perform error reporting in any way they wish.  Analyzer contains an
override of Scanner that mimics the old behavior in order to maintain
compatibility.

2. Static members of ErrorCode (`values` and `byUniqueName`) have been
moved to top level, and remain in analyzer.  To maintain
compatibility, these static members remain in ErrorCode (as deprecated
members that simply wrap the implementations in analyzer).  This means
we have a reverse dependency (front_end depends on analyzer), but this
dependency will go away as soon as we publish the next breaking change
release of analyzer.

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

Review URL: https://codereview.chromium.org/2486873003 .
2016-11-08 13:47:17 -08:00
Brian Wilkerson 562c2be184 Convert generic method errors to hints
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2487583002 .
2016-11-08 11:06:42 -08:00
Jennifer Messerly 68f290c9d8 fix #27764, split STATIC_TYPE_ERROR into more detailed ones
R=leafp@google.com

Review URL: https://codereview.chromium.org/2482573002 .
2016-11-04 17:04:00 -07:00
Brian Wilkerson 9f0e4e1162 Split out error codes into separate files
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2442463002 .
2016-10-20 08:40:36 -07:00
Brian Wilkerson d378dfcff8 Fix error codes (issue 27608)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2430873002 .
2016-10-18 17:30:04 -07:00
Brian Wilkerson 724ac40b8d Improve error messages and add many corrections
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2426583003 .
2016-10-17 10:40:43 -07:00
Lasse R.H. Nielsen efb9a12811 Add = as default-value separator for named parameters.
Fixes issue #27559.

BUG= http://dartbug.com/27559
R=asiva@google.com, eernst@google.com, floitsch@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2411633002 .
2016-10-14 11:25:25 +02:00
pq b681fc5a44 Add ABSTRACT_SUPER_MEMBER_REFERENCE to error code enum.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2376623003 .
2016-09-28 09:26:05 -07:00
Brian Wilkerson f87e62ef14 Convert subclasses of Enum
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2365553004 .
2016-09-23 06:54:26 -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