Commit Graph

102 Commits

Author SHA1 Message Date
Brian Wilkerson 0c1c0afba3 Fix the documentation for ElementVisitor (issue 37151)
Change-Id: I03fbcb022bc92aaa88f65aeb895cad5de0b38e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105100
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:31:04 +00:00
Paul Berry 8d52c0d08e Store library nullability status in LibraryElement; adjust TypeParameterElement.type based on it.
Change-Id: I0a9673b3b2f46bbf5c3aea429e90c6ddafa978e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102224
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 21:27:21 +00:00
Brian Wilkerson f80f0bfcfd Reland "Implement the type Never"
This reverts commit 78e50a5f9b.

Change-Id: I2ec4cdcfda4a6d199308a3b25a2ed0792e9d9a26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 13:26:45 +00:00
Brian Wilkerson 78e50a5f9b Revert "Implement the type Never"
This reverts commit 40a06c3a77.

Reason for revert: Introduced a bug that is blocking a roll.

Original change's description:
> Implement the type Never
> 
> Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iebb5b8327b0be7129298f39b343555b812314abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 16:22:37 +00:00
Paul Berry 797e288796 Clarify how ParameterElement getters behave in the presence of required.
Change-Id: I6f3056669b6760667b2f6ffe158435af1b1fbbd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101243
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-03 14:34:39 +00:00
Brian Wilkerson 40a06c3a77 Implement the type Never
Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-02 16:31:23 +00:00
Brian Wilkerson 2cadc90ec5 Add summary support for isLate
Change-Id: I21fe14778e24477f234e2a1a1fe65a23ebd05e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100274
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 20:23:45 +00:00
Brian Wilkerson c66a67c4a3 Rename isLazy to isLate to reflect change in keyword
Change-Id: Ic4891aa7a9d4d16719cb23a3f5e4afc928087960
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100267
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-23 19:36:25 +00:00
Brian Wilkerson af0fa108da Add support for required named parameters
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 19:25:01 +00:00
Sam Rawlins 284a299543 Fix mustCallSuper for mixins; fixes #36492
This re-lands most of https://dart-review.googlesource.com/c/sdk/+/98443.
This change does not include the "inherited interfaces" bit of that CL,
which some developers have objected to; we'll discuss.

Bug: https://github.com/dart-lang/sdk/issues/36492
Change-Id: Ibaa8ab87c749eae6359b739204c6f286b6818aa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-04-17 22:59:11 +00:00
Brian Wilkerson c2eb9a9860 Add support to the element model for both lazy variables and required parameters
Change-Id: I2733f26cc4ee1be28fc96bbf23402e34449ff030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 12:41:48 +00:00
Sam Rawlins f91de94d33 Add Element.hasOptionalTypeArgs; update strong_test_helper to use more
modern mixins

* Remove AbstractStrongTest.enableNewAnalysisDriver; it is always true.
* Add Element.hasOptionalTypeArgs, which requires changing
  AbstractStrongTest to use PackageMixin and PackageMapUriResolver,
  instead of the custom _TestUriResolver.

Change-Id: Iecb6e37ed5894d42ad965022a8c52e3b5f625655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-04-09 15:13:33 +00:00
Brian Wilkerson 86b5304ccd Revert "Fix mustCallSuper for mixins and inherited interfaces:"
This reverts commit 1ad11facec.

Reason for revert: The CL broke the flutter-analyze bot.

Original change's description:
> Fix mustCallSuper for mixins and inherited interfaces:
> 
> * If a method overrides a mixed in @mustCallSuper method, it should call super.
> * If a method overrides a method from a supertype, which itself overrides a
>   method from an interface, the first method should call super.
> 
> Fixes internal b/70374204.
> 
> Change-Id: I645de4a288a8c5ffff173e97692f8eb6fe38bdb5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98443
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I9339e6a8933f6d25b3bcbdbac0b6a1d304a3693b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-07 16:58:27 +00:00
Sam Rawlins 1ad11facec Fix mustCallSuper for mixins and inherited interfaces:
* If a method overrides a mixed in @mustCallSuper method, it should call super.
* If a method overrides a method from a supertype, which itself overrides a
  method from an interface, the first method should call super.

Fixes internal b/70374204.

Change-Id: I645de4a288a8c5ffff173e97692f8eb6fe38bdb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98443
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-05 16:14:24 +00:00
Brian Wilkerson 6e359857e4 Move ConstantEvaluationTarget out of the task model
Change-Id: I961f033e871a05ba38383b79865ed2795a1d452f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95984
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 16:03:03 +00:00
Paul Berry 09224e4a2b Remove deprecated EMPTY_LIST constants.
Change-Id: I0f5662f56d1c7dc61e6b4a8ff96217b730ae8ffd
Reviewed-on: https://dart-review.googlesource.com/c/89820
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-23 01:45:46 +00:00
Sam Rawlins 9dbb6fb113 Add a Hint enforcing contract of @literal
Example code:

```dart
import 'package:meta/meta.dart';

class A {
  @literal
  const A();

  @literal
  const A.named();
}

var a = A();
var b = const A();
const c = A();
var d = new A();

var e = new A.named();
```

Produces:

Analyzing b.dart...
  hint • This instance creation must be 'const', because the A constructor is marked as '@literal' at b.dart:11:9 • non_const_call_to_literal_constructor
  hint • This instance creation must be 'const', because the A constructor is marked as '@literal' at b.dart:14:9 • non_const_call_to_literal_constructor
  hint • This instance creation must be 'const', because the A.named constructor is marked as '@literal' at b.dart:16:9 • non_const_call_to_literal_constructor
3 hints found.

Bug: https://github.com/dart-lang/sdk/issues/34259
Change-Id: Iba10e5e0a0b2d0f7e99556cd6c201cea229ad675
Reviewed-on: https://dart-review.googlesource.com/c/88422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-01-08 17:20:05 +00:00
Sam Rawlins ce256c762c Impl of INVALID_LITERAL_ANNOTATION
Bug: https://github.com/dart-lang/sdk/issues/34259
Change-Id: Ia5ca627a89dcb3f0fcd5ce74048df8fdf9dd9c9c
Reviewed-on: https://dart-review.googlesource.com/c/88283
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-03 18:07:44 +00:00
Brian Wilkerson d29633f080 Add support for accessing the errors produced during constant evaluation
Change-Id: Iabd13ff201b79a1ca45cf609a9f48ed7e7155b61
Reviewed-on: https://dart-review.googlesource.com/c/84922
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-20 17:47:57 +00:00
Brian Wilkerson 28785aa14d Define the getter Element.session
Change-Id: I467f69d48a3084c444446a785110a5db85b3ecfa
Reviewed-on: https://dart-review.googlesource.com/c/81332
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-26 13:47:32 +00:00
Brian Wilkerson 017e6b184b Add a utility to LibraryElement to access top-level elements without enumerating all of the compilation units (issue 34892)
Change-Id: If5bdc5da20bc0fb524c5f2db47ff46a87d511194
Reviewed-on: https://dart-review.googlesource.com/c/81185
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 22:25:57 +00:00
Brian Wilkerson 67b9f2ec8d Deprecate Element.unit and Element.computeNode
Change-Id: Id2a70b4a194cba28bfdc0990d7306d6561f422db
Reviewed-on: https://dart-review.googlesource.com/c/81060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 16:50:43 +00:00
Brian Wilkerson 5d78509e25 Make FieldElementImpl.isCovariant a public member on FieldElement
Change-Id: I5004f9a18c842a51fcb8901ece8bb7831d237a33
Reviewed-on: https://dart-review.googlesource.com/c/80261
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-16 15:58:46 +00:00
Paul Berry cc884b3449 Remove optional argument from FunctionTypeImpl.forTypedef.
It didn't work properly anyhow (see issue #34657).  Changed the call
sites to use GenericTypeAliasElementImpl.instantiate, which does have
the correct behavior.

Change-Id: I4b9c6cc8ddfcf3b0bebe40b7d874c4630c4b5ae4
Reviewed-on: https://dart-review.googlesource.com/c/79283
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-11 17:36:20 +00:00
Paul Berry b3af151325 Rework detection of uninstantiated bound errors.
We now determine whether a type is simply bounded in the summary
linker, so that we can take advantage of the linker's circularity
detection logic.

Fixes #34635.
Fixes #34636.

Change-Id: I6c5040dbaeb79957d8a84e3f76e6a51834b57f05
Reviewed-on: https://dart-review.googlesource.com/c/78867
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 22:07:02 +00:00
Paul Berry 28780d34df Convert element.dart to triple-slash comment style.
Change-Id: I8af3b0fb06f10ffbc1b9fca6489d3e82ea77dcc6
Reviewed-on: https://dart-review.googlesource.com/c/78600
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-08 20:22:59 +00:00
Brian Wilkerson 6c577f0620 Deprecate Element.isVirtual
Change-Id: I987ba5fbe847c961d698692e0e8b6c98cdbfb30c
Reviewed-on: https://dart-review.googlesource.com/77230
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-29 15:43:43 +00:00
Konstantin Shcheglov 2455141018 Remove ClassElement.isSuperConstructorAccessible().
I don't see it used anywhere outside of Analyzer itself in internal
codebase. So, I think it is safe to remove.

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

Change-Id: If5dafdaaa0f94cf280822418d99ed64060b66d4b
Reviewed-on: https://dart-review.googlesource.com/75562
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-20 16:28:13 +00:00
Konstantin Shcheglov 81ce969060 Enable implicit constructors with optional parameters in mixin applications.
The spec changed in https://github.com/dart-lang/sdk/commit/63c6851dd01514e9d9e6cb96da0430e15b66d576

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34375
Change-Id: If7ba66d82fa4127cc6764d93f299790e8a862b42
Reviewed-on: https://dart-review.googlesource.com/75422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 16:12:21 +00:00
Konstantin Shcheglov d659022f08 Build elements for MixinDeclaration(s).
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ica9912b795bbdfeea2dd46130e30bde3bdc4cef3
Reviewed-on: https://dart-review.googlesource.com/72067
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 21:05:35 +00:00
Konstantin Shcheglov 9c642328ac Summarize mixin declarations.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I2aecbe4e3c5548a8034c51191f58eaf3439b9d76
Reviewed-on: https://dart-review.googlesource.com/71928
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 19:08:56 +00:00
Sam Rawlins ff3908d6df Implement INVALID_SEALED_ANNOTATION analyzer Hint
This follows the pattern of other meta-annotations, when it comes to the AST:

* Element gains a new `hasSealed` getter. Many overrides.
* ElementAnnotation gains a new `isSealed` getter.

Bug: https://github.com/dart-lang/sdk/issues/34232
Change-Id: If8ae8e16b500125cb3b92b3cf83d46de6ca6ee23
Reviewed-on: https://dart-review.googlesource.com/71227
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 22:03:22 +00:00
Brian Wilkerson b8ee603eb2 Deprecate the EMPTY_LIST constants in analyzer
Change-Id: I4c85c8c21207c86003cdb47d499ae9a934606889
Reviewed-on: https://dart-review.googlesource.com/71234
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 14:32:20 +00:00
Brian Wilkerson de3570d8bd Add support for the new mixin feature to the element model
Change-Id: I99344c387c4138438d3d7390bfce15b12e0073ab
Reviewed-on: https://dart-review.googlesource.com/71221
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 00:19:06 +00:00
Sam Rawlins 7818db20a7 Add analysis hint for invalid use of @visibleForTemplate code.
Bug: https://github.com/dart-lang/sdk/issues/33353
Change-Id: Iaafccc3dca6b8d87bd54ed721871c72e9ac456c8
Reviewed-on: https://dart-review.googlesource.com/68432
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 16:51:45 +00:00
Brian Wilkerson e98334a58c Remove remaining references to propagated types and mark the members as deprecated
Change-Id: I2508bc7d6afb36a42e33f0e421f3a39f6d8b4d02
Reviewed-on: https://dart-review.googlesource.com/66142
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-22 23:47:01 +00:00
Paul Berry 9179db84df Resynthesize typedef types properly from kernel.
I broke this functionality when I refactored FunctionTypeImpl into
lazy and strict variants; this CL restores it and simplifies it.

This CL also adds a new method to the analyzer API:
FunctionTypeAliasElement.instantiate(), to allow a client to supply
type arguments to a typedef (as one would at a site where the typedef
is used), to produce a type.  Putting the method in
FunctionTypeAliasElement helps move us toward an API that
distinguishes type "constructors" from types (a generic typedef
defines not just one type but a family of types; to obtain a type one
must instantiate the typedef by supplying type arguments).

Change-Id: I722db2befe2d54fd53d625ddba0dec856a555a7b
Reviewed-on: https://dart-review.googlesource.com/62282
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-06-26 23:32:48 +00:00
Sam Rawlins ed0ba901e1 Doc - Fix library links in analyzer docs
These new links are stil brittle; if dartdoc changes the paths of libraries, or
if `element.dart` gets a `library` directive. But at least they're fixed. There
doesn't appear to be a less brittle solution.

Bug: https://github.com/dart-lang/sdk/issues/27994
Change-Id: Ibff7c01442d10e7133e68500219ac9a5713888b2
Reviewed-on: https://dart-review.googlesource.com/61913
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-06-22 18:40:05 +00:00
Konstantin Shcheglov 8515d74332 Add ImportElement.namespace and use it in completion.
R=brianwilkerson@google.com

Change-Id: I58cadf0e3239ad4ae8584d79485f4d9ebda10eba
Reviewed-on: https://dart-review.googlesource.com/54064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 21:23:48 +00:00
Konstantin Shcheglov b7a63c8d52 Use @isTest and @isTestGroup to understand executable element as a test/group.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2055
Change-Id: I7c8e7639d111eca63df0780ebdec182573493047
Reviewed-on: https://dart-review.googlesource.com/53690
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-04 17:09:06 +00:00
Brian Wilkerson a865531f57 Remove two unused classes from the public API
Change-Id: I4d27bc95d3a3e0ffc3ad379ffd823abf4fff0db1
Reviewed-on: https://dart-review.googlesource.com/51244
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-16 19:15:29 +00:00
Brian Wilkerson dd897d35a2 Move the task API out of the public API
Change-Id: I0fbafb4965ced89fb9a063edb773c3f1cb3a39fa
Reviewed-on: https://dart-review.googlesource.com/51242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-16 18:18:08 +00:00
Brian Wilkerson 1d159e7c23 Rename annotation testing methods in Element
Change-Id: I0f60b9abd3de350e62d89eac0d690a1db40316b7
Reviewed-on: https://dart-review.googlesource.com/45080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-05 17:23:48 +00:00
Brian Wilkerson 5fd560f96b Add getters to replace ParameterKind
Change-Id: I0886c8d032e963857b8054e894ed3343a235b5c2
Reviewed-on: https://dart-review.googlesource.com/44921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-05 14:22:52 +00:00
Sam Rawlins 14629098dd Enforce @visibleForTesting annotations.
In particular, enforce that a method annotated with @visibleForTesting can only
be referenced from within the declaring library, or within a file that has
"/test" in its path. This allows @visibleForTesting methods to be accessed from
test files, or files in "/testing" folders, etc.

Bug: https://github.com/dart-lang/sdk/issues/28273
Change-Id: I3c19f73be330c49face7e3203879742d514bca74
Reviewed-on: https://dart-review.googlesource.com/27201
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 00:17:24 +00:00
Sam Rawlins 0a6253312f Check for @alwaysThrows when evaluating for dead code.
The meta package version 1.1.0 includes a new `alwaysThrows`, which developers
can use to annotate methods that always throw. This helps to avoid erroneous
DEAD_CODE warnings from analyzer.

Bug: https://github.com/dart-lang/sdk/issues/31384
Change-Id: I70e2469b4f3a0d2c87064851160b268ea2259807
Reviewed-on: https://dart-review.googlesource.com/26563
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-07 19:29:18 +00:00
Konstantin Shcheglov e8fe137e94 Remove ExecutableElement.functions and don't resynthesize local functions.
As for all other local elements - variables and labels, we now
created them when we analyze the unit, but we don't export them
through the element model.

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

Bug:
Change-Id: I71eb567f58d6d710fc8a58d1653a66d95ef1ddcd
Reviewed-on: https://dart-review.googlesource.com/9861
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-01 21:08:04 +00:00
Brian Wilkerson 7afa1e2986 Deprecate MethodElement.getReifiedType
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2997333002 .
2017-08-21 16:21:43 -07:00
Konstantin Shcheglov ce4d7b1891 Restore UriReferencedElement and its uri/uriOffset/uriEnd properties.
This is a partial rollback of bdd69ccd6c,
it restores APIs and implementations, but does not restore its usages
in analyzer or analysis_server. Should be enough to make clients
temporary OK, but also keeps resynthesizing from Kernel working.

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

Review-Url: https://codereview.chromium.org/2991453002 .
2017-07-21 16:59:52 -07:00
Konstantin Shcheglov bdd69ccd6c Remove UriReferencedElement with its uri/uriOffset/uriEnd properties.
The 'Move File' refactoring does not work, so I comment out most
of its code.

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

Review-Url: https://codereview.chromium.org/2982993003 .
2017-07-19 09:31:03 -07:00