Commit Graph

8489 Commits

Author SHA1 Message Date
pq 8ebe354ecc fix diagnostic messages for named constructors
Fixes: https://github.com/dart-lang/linter/issues/1986

Change-Id: I67ba3393be48dc39d3bbaaa922542f11b138afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-24 18:50:13 +00:00
Brian Wilkerson 9ac5aabe77 Fix an incorrect type annotation (issue 40299)
Change-Id: Id461b5d798f58f182c2b84fa30b5f9a94e51b4fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133154
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-24 14:27:39 +00:00
Konstantin Shcheglov 3962edccf1 Convert opt-in elements to legacy when resolving annotations.
Change-Id: Ifc32ec66e9e45dcaa206c662785bb7d4c054b701
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133166
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-24 01:34:11 +00:00
Konstantin Shcheglov c92b3e6f86 Fixes for NORM and FunctionType(s) - type parameters, and covariant formal parameters.
I think this will fix the issue that required revert of:
https://dart-review.googlesource.com/c/sdk/+/133041

Change-Id: Ib25ea9c9ac9743dee560fb688cd026fa3b3fe6bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 22:44:43 +00:00
Konstantin Shcheglov fb667d2ae4 Revert "Use NNBD_TOP_MERGE to combine signatures of the inherited members."
This reverts commit 0391d1fc7f.

Reason for revert: Breaks the build: https://ci.chromium.org/p/dart/builders/ci.sandbox/analyzer-nnbd-linux-release/1045

Original change's description:
> Use NNBD_TOP_MERGE to combine signatures of the inherited members.
> 
> Change-Id: I314eac1b9175409e6b2b05afd3b97d44c1156cf8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133041
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: I15f73853b39a93fa2038aefea95aa1b364ca3d5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133086
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 18:59:48 +00:00
Konstantin Shcheglov 0391d1fc7f Use NNBD_TOP_MERGE to combine signatures of the inherited members.
Change-Id: I314eac1b9175409e6b2b05afd3b97d44c1156cf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 17:25:07 +00:00
Konstantin Shcheglov eb271d997f Update NNBD_TOP_MERGE for pending updates to the spec.
These changes are not yet in the spec, but it seems that we want
them before we can start using NNBD_TOP_MERGE for merging interfaces.

Change-Id: I4ba0f95b169febd05a2cbc1a50edf342227ee217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132971
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 03:35:11 +00:00
Konstantin Shcheglov 582727a4ec Tests for TypeName resolution, fixes for NNBD opt-in/out mixes.
Change-Id: Ifb119a266306dbdf8a712d3110038179ee3cd7f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132965
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-23 01:01:00 +00:00
Konstantin Shcheglov 7f2a5b54a4 Support for instantiating opt-in classes from legacy libraries.
Change-Id: I3cafd51936a4af97d63424d6c8612570d27ac031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-22 19:58:08 +00:00
Konstantin Shcheglov 02f1244921 Fix reporting of uninitialized field errors after a redirecting constructor.
Change-Id: I868cec4a09ebdfce271d861b714c2100e812c5c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132808
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2020-01-22 19:53:48 +00:00
Konstantin Shcheglov 0b06a369de Replace ClassElement/FunctionTypeAliasElement.instantiateToBounds() with TypeSystem.instantiateToBounds2()
Change-Id: I2b1aacc9d72ab444176a2a0e4d6a44d13780e357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 18:38:48 +00:00
Konstantin Shcheglov b663ef5cc4 Build non-nullable or legacy SDK summary.
Bug: https://github.com/dart-lang/sdk/issues/38666
Change-Id: I24f6f36b5ed1dbef64588dd787aaf2abbd62f53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 18:02:08 +00:00
Konstantin Shcheglov 52c535cd83 Issue 35908. Remove DartObjectImpl types comparison workaround.
Bug: https://github.com/dart-lang/sdk/issues/35908
Change-Id: Icff1d3a19adddea0b15469cf93c2a90b8dd1b43e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-22 15:13:28 +00:00
Paul Berry 47950b5153 Migration: add logic to remove unnecessary "as" expressions.
Only works when the FixBuilder is enabled.

Change-Id: I9f2ee95603f9b6b247eae1ba00e817a71fc299d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132681
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 00:05:34 +00:00
Konstantin Shcheglov 1c56176084 Parse --packages file as package_config.json or .packages, depending on the content.
Bug: https://github.com/dart-lang/sdk/issues/38554
Bug: https://github.com/dart-lang/sdk/issues/39762
Change-Id: Ibce0cabd75ecbfd3aa4e573418c2127ff7f9687e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-21 23:07:59 +00:00
Konstantin Shcheglov 1478e48ea5 Issue 39833. Report an error when a function typed formal parameter has question and the experiment is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/39833
Change-Id: I742396890692cef6a5befa58f7717b3971c82257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-21 21:30:19 +00:00
Paul Berry 16cb7cee1b Convert builder.dart to triple-slash comment style
Change-Id: I73e371b073ef2f7448a175b5fdb85bd77d8529a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-21 15:58:02 +00:00
Konstantin Shcheglov 7e0726e077 Fix for asking constant value from a VariableMember.
Change-Id: If67b0922010b730e887a764383889f0ee3e790c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-18 01:11:47 +00:00
Brian Wilkerson e2751d8d45 Clean up a couple of hints
Change-Id: Ib925a603e3e751cc54c89f7a6fab759601dd8979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132361
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-17 22:52:27 +00:00
Konstantin Shcheglov 58a65fe4ba Issue 40110. Update switchStatement_end() to 'isExhaustive', use for switch on enum in analyzer.
Bug: https://github.com/dart-lang/sdk/issues/40110
Change-Id: Ic17ab4562f518b7e69b78c3285b577ea3b8d1223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131712
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 22:07:16 +00:00
Mike Fairhurst d234c45f5b Remove unnecessary @override
Change-Id: I48d2d1e3324838e2814f566de937db6cb061b12f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132308
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 21:17:56 +00:00
Paul Berry cacfb70f7b Migration: further support for adding ?s to types in FixBuilder.
Previously, we tried to hook in to the resolver so that every time it
tried to check the type of a TypeAnnotation, the FixBuilder would see
if it needed to add a `?` to it before letting the resolver continue.
This was clumsy and didn't catch all the TypeAnnotations.  This CL
changes to a simpler technique where we simply visit all
TypeAnnotations, making note of where we need to add `?`s and updating
types, prior to re-running resolution.

Change-Id: Idf5ba286415fb2b90e2cd1d5ba3635b6b559aef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132164
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-17 20:47:16 +00:00
Konstantin Shcheglov 03432747b9 Fix resolveNameInScope() for import scope.
R=brianwilkerson@google.com, pquitslund@google.com

Bug: https://github.com/dart-lang/linter/issues/1970
Change-Id: I6f3798950d6d20f444e731aea22b2e41516e1081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 20:00:36 +00:00
Konstantin Shcheglov 2d33d4eec9 Re-read condition after resolution, it might be rewritten.
Bug: https://buganizer.corp.google.com/issues/147866900
Change-Id: I1f18c52a569a813b454893ad02d3263897d4679b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 18:42:04 +00:00
Konstantin Shcheglov 2aee6026cb Use NullableDereferenceVerifier in BoolExpressionVerifier.
So, we report UNCHECKED_USE_OF_NULLABLE_VALUE in one place, and only
during resolution.

Change-Id: I0c89f77afe1c311287906e27458a226965545369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132171
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 17:20:34 +00:00
Johnni Winther 47743990a1 [cfe] Provide file offset on StringConcatenation
Change-Id: I70d5f47fd118f9b40c01f0f71057bd8e244561d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132240
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-17 09:48:12 +00:00
Konstantin Shcheglov 746d3fb757 Use BoolExpressionVerifier in BinaryExpressionResolver.
Change-Id: I249b475a3a5b35e1de6f59b7f9cd30102709bb29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132167
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 00:20:15 +00:00
Konstantin Shcheglov d19b2b0349 Use NullableDereferenceVerifier in resolver instead of ErrorVerifier.
Change-Id: Ib360bd9091656e04820879052a04e6ee23c495d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-16 22:55:49 +00:00
Konstantin Shcheglov 356fa11349 Extract BoolExpressionVerifier.
Mostly because it also reports UNCHECKED_USE_OF_NULLABLE_VALUE, and
we want to report it during resolution, to use for migration.

Change-Id: I89f988d9be34a70dfe0e590a5fede2696423c89c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132029
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 22:30:18 +00:00
Konstantin Shcheglov 445c0842c7 Use nullable context type for operand of null-check operator. (2)
Initial: https://dart-review.googlesource.com/c/sdk/+/131343
Reverted: https://dart-review.googlesource.com/c/sdk/+/131461

Bug: https://github.com/dart-lang/sdk/issues/39694
Change-Id: I6287338ce347ddc45d6cc1f3cb16fdccbc75c891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 22:30:09 +00:00
Paul Berry 37753f016c Add methods to CollectionElementProvider to get type arguments of typed literals.
We will need to hook into this for migration as well, because the type
arguments of typed literals will be changed by migration from star
types to either nullable or non-nullable types.

Change-Id: Ie721390effd9cf733b9f977c1ba729f6fc4b2ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 3af7abc78b Migration: Remove source parameter from MigrationResolutionHooks API.
The source is already known to the FixBuilder, so it is redundant.

Change-Id: Iafafd6514bbe469ebc2136a65984b388f5c64342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131881
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Paul Berry 3f02e7d749 Migration: add FixBuilder support for generic function type annotations.
Change-Id: Ifca6d611da8d95cfc243c32a3af8bd3a1f03bd54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131880
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 22:03:48 +00:00
Konstantin Shcheglov 04a121dea9 Split different operators resolution in BinaryExpressionResolver.
R=brianwilkerson@google.com

Change-Id: I1a4c77d9095aee6aeb0243425d61e9e7ad671eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 19:41:48 +00:00
Konstantin Shcheglov b94a12b60b Don't flag Never as not available when the non-nullable feature is enabled for the library.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/39597
Change-Id: I5865f467a3b5097fb863d172321f60cbe1f5fd44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132023
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-16 18:49:27 +00:00
Konstantin Shcheglov c1d2ccfe34 Don't look for Flutter specific analysis options in Bazel workspaces.
Bug: https://buganizer.corp.google.com/issues/147794766
Change-Id: Ia0e085157d89e9d3cd70580622ff6af3f3f141f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 18:10:47 +00:00
Konstantin Shcheglov 8c82979b76 Revert "Remove StrongModeCode.IMPLICIT_DYNAMIC codes."
This reverts commit a3ea61c3d0.

We decided that analyzer should continue to provide this
functionality, at least until we have a better replacement.

Bug: https://github.com/dart-lang/sdk/issues/40129
Change-Id: Idd5ae37a6b8f8d39d374df2b0aaa04d7ee8bf3d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131723
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-16 17:37:57 +00:00
Konstantin Shcheglov c0a501ba8d Report LATE_FINAL_LOCAL_ALREADY_ASSIGNED also for prefix / postfix expressions.
Change-Id: I9c47e0a992b807c18a26af885902d4196fe64772
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131907
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 17:28:47 +00:00
Konstantin Shcheglov 9ed450f376 Remove imports (unused) to package_config.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/39762
Change-Id: I616dfc8b3798276a8043933c70de74a997ae5e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131948
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 17:28:26 +00:00
Paul Berry 2b756f6b02 Migration: add FixBuilder support for IfElement.
One minor issue remains: when dead code elimination causes a
collection to become empty, migration should insert explicit type
parameter(s) to ensure that the empty collection will still get
analyzed as having the right type.  This is noted in TODO comments.

Change-Id: Ibed25f6cb8ed9eec3ddccb0444178960c6b35c84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131843
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-16 06:45:35 +00:00
Paul Berry 53bef4bb07 Create an abstract layer to customize querying collection elements.
This will be needed for the NNBD migration engine, so that when it
re-runs resolution to see what the types will be in migrated code, it
can tell the resolver to skip or modify collection elements to account
for dead code elimination.

The runtime overhead of this abstraction should be negligible, since
under normal analyzer operation, there will only be a single const
instance of this class, and no instances of any subclasses.  So the VM
should be able to trivially inline all uses of the abstraction layer.

Also add SetOrMapLiteralImpl.becomeUnresolved(), which is used to
reset literals to the "unresolved" state before they are resolved.
This will be necessary so that when the migration engine re-resolves a
set or map literal, the determination of what kind of literal it is
will be made afresh.

Change-Id: Id8e95c944acb892c60d3d92a7facc20d08604211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131842
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-16 06:45:35 +00:00
Konstantin Shcheglov 6525fc9057 Fix for crash: type 'DefaultParameterElementImpl' is not a subtype of type 'FieldFormalParameterElementImpl'
#0      ResolutionVisitor.visitFieldFormalParameter (package:analyzer/src/dart/resolver/resolution_visitor.dart:458:7)
#1      FieldFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:4123:49)
#2      ResolutionVisitor.visitDefaultFormalParameter (package:analyzer/src/dart/resolver/resolution_visitor.dart:370:21)
#3      DefaultFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:2999:15)
#4      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#5      FormalParameterListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4451:17)
#6      RecursiveAstVisitor.visitFormalParameterList (package:analyzer/dart/ast/visitor.dart:887:10)
#7      FormalParameterListImpl.accept (package:analyzer/src/dart/ast/ast.dart:4447:49)
#8      ResolutionVisitor.visitFunctionExpression.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:596:25)
#9      ResolutionVisitor._withNameScope (package:analyzer/src/dart/resolver/resolution_visitor.dart:1275:8)
#10     ResolutionVisitor.visitFunctionExpression.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:591:7)
#11     ResolutionVisitor._withElementHolder (package:analyzer/src/dart/resolver/resolution_visitor.dart:1253:8)
#12     ResolutionVisitor.visitFunctionExpression (package:analyzer/src/dart/resolver/resolution_visitor.dart:590:5)
#13     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:4969:49)
#14     ResolutionVisitor.visitVariableDeclaration.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:980:27)
#15     ResolutionVisitor._withElementHolder (package:analyzer/src/dart/resolver/resolution_visitor.dart:1253:8)
#16     ResolutionVisitor.visitVariableDeclaration.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:979:9)
#17     ResolutionVisitor._withElementWalker (package:analyzer/src/dart/resolver/resolution_visitor.dart:1264:8)
#18     ResolutionVisitor.visitVariableDeclaration (package:analyzer/src/dart/resolver/resolution_visitor.dart:971:7)
#19     VariableDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:10408:49)
#20     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#21     VariableDeclarationListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:10512:16)
#22     ResolutionVisitor.visitVariableDeclarationList (package:analyzer/src/dart/resolver/resolution_visitor.dart:995:10)
#23     VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:10506:15)
#24     FieldDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3993:17)
#25     RecursiveAstVisitor.visitFieldDeclaration (package:analyzer/dart/ast/visitor.dart:857:10)
#26     ResolutionVisitor.visitFieldDeclaration (package:analyzer/src/dart/resolver/resolution_visitor.dart:449:11)
#27     FieldDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:3988:49)
#28     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7520:20)
#29     ResolutionVisitor.visitClassDeclaration.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/resolver/resolution_visitor.dart:245:22)


Change-Id: I2402751a3b88e9df934a2f6660813826244f827a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-15 21:10:47 +00:00
Konstantin Shcheglov 9ae4849386 Report LATE_FINAL_LOCAL_ALREADY_ASSIGNED.
Change-Id: Ifa1706b6aecf53ec15578b13a4cc5931fbba3b2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-15 19:28:56 +00:00
Johnni Winther 862d5012ae [cfe] Handle explicit opt-out in nnbd-not-enabled message
Closes #39835

Change-Id: I4ffa3377289f45b7ea909b5477ba53508040b9d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131076
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-15 10:30:43 +00:00
Konstantin Shcheglov 924f4e0549 Downgrade receiver of type Never to hint.
Bug: https://github.com/dart-lang/sdk/issues/40057
Change-Id: I49f56b7efa4c88a86fda071c6063b308062784bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-15 01:33:24 +00:00
Konstantin Shcheglov b68f844570 Issue 40057. Fix for Never as setter receiver.
Bug: https://github.com/dart-lang/sdk/issues/40057
Change-Id: Ia53e01b7aa5e41a80e88b14aabdffc31cbc683b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131706
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-14 21:33:23 +00:00
Paul Berry fc8a02ee3c Pass TypeSystem and TypeProvider into TypedLiteralResolver.
Previously, TypedLiteralResolver obtained them from the library, but
this didn't work when the resolver was invoked by the migration tool,
because the migration tool needed to re-run migration of a non-NNBD
library using the NNBD TypeProvider and TypeResolver.

Change-Id: I73acca120a726c773c2e08b65d1227531a5fd2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131704
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry 9786c9c063 Migration: wire up elimination of dead if branches to FixBuilder.
Change-Id: I317c2476aa21e556333729893872b937a46a82e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131583
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-14 20:41:23 +00:00
Paul Berry a57350be7b Migration: Add logic to FixAggregator to eliminate dead "if" branches.
Change-Id: Icfe62535f588c691086835ae22c80b49191be514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-14 20:41:23 +00:00
Konstantin Shcheglov 96cbfb4a2c Issue 39059. Check for minor / major version overflow.
Bug: https://github.com/dart-lang/sdk/issues/39059
Change-Id: I78a5598b2433d772409a41f7c6e87b32f859c6be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131705
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-14 20:08:13 +00:00