Commit Graph

974 Commits

Author SHA1 Message Date
Konstantin Shcheglov f797154673 Fix for LibraryDirective annotations while applying resynthesized element model.
This allows us to clean up the analysis driver.

I will NOT land this without your review.

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

Review URL: https://codereview.chromium.org/2445193003 .
2016-10-26 07:40:07 -07:00
Brian Wilkerson 785b949894 Improve error recovery (issue 27646)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2444453002 .
2016-10-21 12:36:01 -07:00
Paul Berry 396d7862b4 More improvements to DeclarationResolver.
This CL makes the following improvements:

- When visiting an executable element, local variables and labels are
  rebuilt rather than matching them up to the old element model.  This
  ensures that if the element model was resynthesized from an API
  summary (which doesn't contain local variables or labels), these
  elements are not lost.

- When matching up existing elements, if the elements did not
  previously contain offsets, offsets are recorded.  If they did
  previously contain offsets, the offsets are compared to verify that
  they match.  This ensures that if the element model was
  resynthesized from an API summary (which doesn't contain offsets),
  the offsets will be correct.

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

Review URL: https://codereview.chromium.org/2435313002 .
2016-10-21 11:13:55 -07:00
Vyacheslav Egorov 1f6e03883e Teach analyzer parser to handle native const factories/const constructors.
This is needed to parse VM patch files, which contain things like:

@patch const factory String.fromEnvironment(String name,
                                              {String defaultValue})
      native "String_fromEnvironment";

Currently analyzer would throw "Only redirecting factory constructors can be
declared to be 'const'." error when it sees this code.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2435013003 .
2016-10-20 20:09:07 +02:00
Konstantin Shcheglov bf43e4b43e Validate local resolution scope, and compute initial name scope.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2439583003 .
2016-10-19 14:08:46 -07:00
Konstantin Shcheglov 38e2b55fff Implement 'local' mode in TypeResolverVisitor.
If we start resolution not from CompilationUnit, we need to put type
parameters into scopes. This is not implemented yet.

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

Review URL: https://codereview.chromium.org/2432273003 .
2016-10-19 09:47:40 -07:00
Konstantin Shcheglov b64e116422 Add TypeResolverMode and implement 'api' in TypeResolverVisitor.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2428233002 .
2016-10-18 19:31:14 -07:00
Konstantin Shcheglov 13d2420a3d Extract ElementBuilder tests into a separate file.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2430723002 .
2016-10-18 10:22:45 -07:00
Konstantin Shcheglov e1f8a0a103 Begin separating API and local element builders.
I will write separate tests for them and do some more clean up in
separate CLs.

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

Review URL: https://codereview.chromium.org/2425853003 .
2016-10-18 08:22:30 -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
Brian Wilkerson 3155b1e08c Remove unused method and field from DartSdkManager
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2415413003 .
2016-10-14 09:53:44 -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
Brian Wilkerson 1a893edb82 Add prefix to path import to work around breaking change
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2411423003 .
2016-10-13 08:29:09 -07:00
Paul Berry cf5f9e0a38 Move class DeclarationResolver to its own file.
Auxiliary classes ElementGatherer, ElementMismatchException, and
ExistingElementResolver, which were only used by DeclarationResolver,
are also moved.

(No functional change; just code motion).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2406863003 .
2016-10-10 11:43:26 -07:00
Konstantin Shcheglov 4511504171 Implement BazelPackageUriResolver.restoreAbsolute().
It is mostly tested with the same tests as for resolveAbsolute().

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

Review URL: https://codereview.chromium.org/2403733002 .
2016-10-10 08:16:00 -07:00
Konstantin Shcheglov 78051dc47d Add more tests for BazelPackageUriResolver.resolveAbsolute().
Create separate set of resources in each test in order to simplify the
tests.

Fix the case when files are generated for third_party/dart/XXX.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2403723002 .
2016-10-09 14:40:18 -07:00
Brian Wilkerson 789fd11ebf Get more tests passing on windows
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2397933006 .
2016-10-08 11:09:20 -07:00
Brian Wilkerson 6446cab391 Guard against exceptions thrown by linters (issue 27545)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2407553002 .
2016-10-07 14:37:39 -07:00
Konstantin Shcheglov 51f617c0d3 Automatically identify the workspace suffix for READONLY.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2406603002 .
2016-10-07 14:24:10 -07:00
Konstantin Shcheglov 5e5f3cfa60 Automatically detect 'blaze' or 'bazel' symlink prefix.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2401993002 .
2016-10-07 13:08:13 -07:00
Konstantin Shcheglov 84b1a98173 Replace BazelWorkspace factory with the static 'find' method.
This is a breaking change:

1. The factory constructor was removed.
2. The method find() may return null.

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

Review URL: https://codereview.chromium.org/2402713002 .
2016-10-07 10:15:32 -07:00
Konstantin Shcheglov f63b3d3e7b Add BazelPackageUriResolver with resolveAbsolute().
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2393963004 .
2016-10-07 09:19:53 -07:00
Konstantin Shcheglov 59e8af7047 Report CompileTimeErrorCode.DUPLICATE_PART when not only URI, but even Source is the same.
There is one usecase when strongly speaking the error should not be
reported - when the part is empty. But that still does not seem practical.

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

Review URL: https://codereview.chromium.org/2401783002 .
2016-10-06 20:44:28 -07:00
Paul Berry f9c819057b Fix null reference issues in bazel.dart.
There were two issues:

- We were trying to use `parent` before null checking it.

- In the event that no workspace root could be found, we were returning
  `null` from the BazelWorkspace factory constructor.  This CL changes
  the behavior so that we return a BazelWorkspace that has no special
  bin or genfiles behaviors.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2394213002 .
2016-10-06 14:21:17 -07:00
Brian Wilkerson 6de0803deb Clean up hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2394733004 .
2016-10-06 12:59:38 -07:00
Konstantin Shcheglov 26cc95d8b4 Issue 27515. Report DUPLICATE_PART when the same library contains two part directives with the same URI.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/27515

Review URL: https://codereview.chromium.org/2401463004 .
2016-10-06 11:28:05 -07:00
Brian Wilkerson 2328bef00b Fix more tests on windows bots
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2398113002 .
2016-10-06 10:21:01 -07: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
Konstantin Shcheglov 8a3d8eee67 Add BazelWorkspace and move BazelFileUriResolver to it.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review URL: https://codereview.chromium.org/2393813003 .
2016-10-05 18:08:07 -07:00
Brian Wilkerson a52e53a3b2 Fix BazelFileUriResolver tests
R=jwren@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2392133002 .
2016-10-04 14:17:18 -07:00
Brian Wilkerson db73915c77 More fixes for testing under windows
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2393663002 .
2016-10-04 13:11:57 -07:00
Brian Wilkerson 154bd389db Fix some failures on the windows bots
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2392793003 .
2016-10-04 08:21:28 -07:00
Brian Wilkerson 29c5c9985e Remove JavaFile.pathContext
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2386123004 .
2016-10-03 19:28:49 -07:00
John Messerly 5c9e12497e fix #27135 and fix #27449 strong mode does not use propagated types
R=leafp@google.com

Review URL: https://codereview.chromium.org/2380863003 .
2016-09-29 00:14:07 -07:00
Konstantin Shcheglov 3f6afd8cf5 Add tests for resolveRelativeUri() and a workaround.
The actual problem should be fixed in SDKs Uri implementation.
https://github.com/dart-lang/sdk/issues/27447

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2376073003 .
2016-09-28 13:20:26 -07:00
Konstantin Shcheglov 85d3aff259 Issue 25706. Fix for resolving '@prefix.ClassName.staticVariable.'.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/25706

Review URL: https://codereview.chromium.org/2376463002 .
2016-09-26 10:59:40 -07:00
Lasse R.H. Nielsen 574ae435f3 Allow surrogates in string literals.
Fixes issue #26620
BUG: http://dartbug.com/26620

R=asiva@google.com, brianwilkerson@google.com, floitsch@google.com, hausner@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2304923002 .
2016-09-26 13:23:41 +02:00
Konstantin Shcheglov 0223b08a34 Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE. (Land again)
The pkg/analysis_server/test/integration/analysis/error_test was fixed.

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

Review URL: https://codereview.chromium.org/2366963002 .
2016-09-23 10:21:21 -07:00
Paul Berry fe2c152ee2 Revert "Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE."
This broke the analyzer bots.  See for example https://build.chromium.org/p/client.dart/builders/analyzer-mac10.11-release-be/builds/337/steps/analysis%20server%20unit%20tests/logs/stdio

This reverts commit 77ba5fd087.

TBR=scheglov@google.com

Review URL: https://codereview.chromium.org/2361393002 .
2016-09-23 05:24:53 -07:00
Konstantin Shcheglov 77ba5fd087 Issue 27300. Report HintCode.ABSTRACT_SUPER_MEMBER_REFERENCE.
There are no positives in analyzer/server, dev_compiler or dart2js.

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

Review URL: https://codereview.chromium.org/2364733002 .
2016-09-22 14:27:47 -07:00
Brian Wilkerson fd7bb76a4b Add some errors related to nnbd
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2362873002 .
2016-09-22 13:43:37 -07:00
Konstantin Shcheglov 65d2a2ce82 Issue 27392. Fix for invoking objects with function-bounds type parameter types.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27392

Review URL: https://codereview.chromium.org/2360303003 .
2016-09-22 11:50:24 -07:00
Brian Wilkerson 454289dbe3 (TBR) Fix test failure
Review URL: https://codereview.chromium.org/2357303002 .
2016-09-21 09:10:40 -07:00
Brian Wilkerson d947a7ba89 Async is no longer optional
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2361433002 .
2016-09-21 08:29:34 -07:00
Brian Wilkerson 6062d5d6bd Fix mustCallSuper to ignore methods from interfaces
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2348383006 .
2016-09-21 08:03:09 -07:00
Brian Wilkerson d0245ea2b9 Finish removing MethodTrampoline
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2356653003 .
2016-09-20 08:20:56 -07:00
Brian Wilkerson 57f1193c01 First steps toward removing MethodTrampoline
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2348353002 .
2016-09-19 08:24:29 -07:00
Brian Wilkerson 772c93ccf2 Rename libraryUri
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2347213002 .
2016-09-16 10:54:25 -07:00
Brian Wilkerson 7eb7573dc4 Initial support for the NNBD proposal
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342383002 .
2016-09-16 10:51:19 -07:00