Commit Graph

8489 Commits

Author SHA1 Message Date
paulberry@google.com 5ff3e4a594 Incremental parser fix: handle insertion of "final" before field decl.
This bug was discovered by the incremental parse stress tester.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41837 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 15:34:38 +00:00
scheglov@google.com f551b6964c Extract incremental resolver classes into separate files.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41819 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 01:18:07 +00:00
danrubel@google.com 8cd596e82c add source changed event stream
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41818 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 01:02:42 +00:00
scheglov@google.com 438fbd7f6b Cache ElementLocation instance and index key/location ids.
This saves us about 9% of time, as the previous CL.
From 22294 ms to 20040 ms.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41814 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 23:02:14 +00:00
paulberry@google.com 4ef51cb52e Fix incremental parsing of function literals in initializer lists.
One of the areas in which the Dart grammar is context sensitive is the
fact that function literals are disallowed inside initializer lists
(unless they are enclosed inside (), [], {}, or "${}").

To deal with this context sentitivity in incremental parsing, we must
rebuild the correct parser state for the subexpression we are going to
re-parse before parsing it.  We do so with a new visitor,
IncrementalParseStateBuilder.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41813 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 22:49:59 +00:00
scheglov@google.com 58587a470e Rollback r41807.
As discussed, it is not compatible with the incremental analysis.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41809 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 18:50:28 +00:00
scheglov@google.com 4032b4d86b Use shorter DartElementLocation.
This improves analyzer + analysis_server analysis time from 21841 ms to 19839 ms.
I.e. about 9% faster.

However it is still 25% slower than without index at all - 15593 ms.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41807 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 16:21:01 +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
danrubel@google.com fabddbd918 add ContextsChangedEvent
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41786 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 17:14:48 +00:00
scheglov@google.com 30e11469c3 Use a better way to compute InterfaceTypes least upper bound.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41761 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-15 16:52:58 +00:00
brianwilkerson@google.com 35b13e0885 Make constant lists immutable
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41757 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-15 01:33:57 +00:00
scheglov@google.com 2521c3703d Fix formatter breakage.
Constants are special.

R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41748 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 19:16:58 +00:00
scheglov@google.com 0a93cdbf9f Report HintCode.UNUSED_ELEMENT for functions.
1 positive in dart2js
1 positive in analysis_server
0 positives in analyzer

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41746 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 19:10:35 +00:00
paulberry@google.com c54f6e774c Improve error reporting when a mixin application is invalid.
For a situation like this:

  class B {
    B({int i});
  }
  class M {}
  class C extends B with M {
    C() : super();
  }

we report the error at the node "with M", with the message "This mixin
application is invalid because all of the constructors in the base
class 'B' have optional parameters.".

Previously we would report the error at the site of the super call,
leaving the user no idea why there was a problem.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41745 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 18:04:55 +00:00
brianwilkerson@google.com eb6aa7cacc Code clean-up and minor bug fix
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41744 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 16:06:11 +00:00
scheglov@google.com 256c3ddbe7 Remove unused fields in analyzer.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41742 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 15:43:24 +00:00
scheglov@google.com 9e4a3ec845 Report HintCode.UNUSED_FIELD
There are two positives in dart2js, valid as I can see.
There are several positives in analyzer and analysis_server.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41727 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 23:12:40 +00:00
brianwilkerson@google.com 815e9ae0b7 Code clean-up
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41725 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 20:01:57 +00:00
scheglov@google.com 890f2c34cd Report HintCode.UNUSED_ELEMENT for non-synthetic property accessors.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41723 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 17:16:09 +00:00
scheglov@google.com 5f2f7a44bd Remove some (but not all) unused methods in analyzer.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41721 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 17:07:54 +00:00
whesse@google.com 113bb8dc60 Allow dartanalyzer to parse options after the filename argument.
BUG=dartbug.com/21582
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41719 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 16:32:15 +00:00
scheglov@google.com 0b2216978f Report HintCode.UNUSED_ELEMENT for unused methods.
No positives in dart2js.

Several positives in analyzer - not finished _notifyX methods in AnalysisContextImpl,
not used (saved for later?) methods in BestPracticesVerifier, some other methods.

Several positives in analysis_server, actual problems.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41717 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 15:41:44 +00:00
whesse@google.com 31d13c3a19 Renumber enum constants in analyzer to be consecutive.
There is a unit test that expects them to be consecutive.

BUG=
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41710 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 11:58:35 +00:00
scheglov@google.com 36d8576a8a Move unused local variables and classes analysis into HintGenerator.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41696 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-12 20:04:27 +00:00
scheglov@google.com 829ea71487 First fix for indexing slowness.
We can make it even faster, but this change alone reduces time
from 55000 ms to 22600 ms.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41679 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 23:05:46 +00:00
paulberry@google.com 9bc06fbf41 Workaround for ConstantVisitor dependency issues.
This restores proper test functionality on the buildbots.  I plan to
follow up with a more permanent fix.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41676 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 22:55:58 +00:00
scheglov@google.com 21fa0f35f8 Issue 21549. Fix for infinite loop in the Angular expression parser (Dart version).
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21549

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41672 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 21:10:57 +00:00
scheglov@google.com 24a93f8cee Report HintCode.UNUSED_ELEMENT for classes.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41650 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 02:57:23 +00:00
brianwilkerson@google.com 93cecbd276 Fix hurt recovery
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41646 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 19:38:15 +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 c258a1d7f6 Create fewer unnecessary lists
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41641 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 17:25:58 +00:00
brianwilkerson@google.com d23df4f448 Clean up references in comments
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41623 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 15:45:19 +00:00
brianwilkerson@google.com f4f12546ad Fix for issue 20796
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41622 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 04:48:44 +00:00
paulberry@google.com 9c1ea65f07 Prevent conflict between parameter names and local function names.
From section 9.2 (Formal Parameters) of the spec:

  The formal parameter list of a function introduces a new scope known
  as the function's formal parameter scope.  The formal parameter
  scope of a function f is enclosed in the scope where f is declared.

Therefore, if one of the function's parameters has the same name as
the function itself, that isn't a problem.

Previously, we would add a local function to its own formal parameter
scope before visiting it (to allow it to call itself recursively), and
then after visiting it we would add it to the scope of the enclosing
function (so that the enclosing function could call it).

The fix is to add the local function just to the scope of the
enclosing function, and to do it before visiting the local function so
that recursion still works.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41621 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-08 01:11:17 +00:00
brianwilkerson@google.com 009128c945 Fix issue 20577
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41616 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 21:33:44 +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
paulberry@google.com 8ff8367558 Additional fixes to printing of error codes.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41611 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 17:43:28 +00:00
brianwilkerson@google.com d289dda555 Fix remaining error code classes
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41606 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 16:24:15 +00:00
danrubel@google.com 668cb980bb ignore exceptions during shutdown
BUG=dartbug.com/21520
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41585 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 21:40:29 +00:00
brianwilkerson@google.com debee8c776 Fix for issue 19100 - better recovery
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41584 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 21:37:27 +00:00
scheglov@google.com 772a0c6b22 Fix 'Unused local variable' hints in analyzer and analysis_server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41576 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 18:32:54 +00:00
brianwilkerson@google.com 7ea594bff5 Clean up error codes
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41574 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 17:55:11 +00:00
scheglov@google.com ca91f9f770 Report HintCode.UNUSED_LOCAL_VARIABLE for local variables whose value is never used.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41568 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 17:00:28 +00:00
scheglov@google.com df6233ae4a Use Element's source paths instead of URIs as a key in the index.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41530 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 21:02:37 +00:00
brianwilkerson@google.com ba4274b529 Fix documentation (for issue 19253)
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41527 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 17:28:02 +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 92b1c25f83 Avoid traversing classes when looking for circular references in typedefs.
BUG=dartbug.com/19459
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41525 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 16:58:56 +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
paulberry@google.com ae271bf236 Split the largest classes from resolver.dart to their own files.
This should make resolver.dart small enough to support side-by-side
diffs in the code review tool.

R=scheglov@google.com

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

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