Commit Graph

3034 Commits

Author SHA1 Message Date
Brian Wilkerson ad021d02d4 Integrate the latest batch of reviewed diagnostic docs
This includes a small improvement to the validation tests, but there is
also one code whose docs can't be verified without additional work that
I will do in a follow-on CL.

It also includes splitting one code into two to improve the messages.

Change-Id: I52989ca336e42822327e3ac3805b1654d20a479c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125901
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 15:21:55 +00:00
Konstantin Shcheglov 615928c514 Stop referencing non-API TypeSystem in analyzer.
Replace it with TypeSystem from lib/dart/element/type_system.dart,
or (internally) with TypeSystemImpl.

We keep the old TypeSystem where its is exposed from API:
- ResolveResult.typeSystem
- AnalysisSession.typeSystem
- AnalysisContext.typeSystem

  We will make changes to these as a breaking change later.

Change-Id: I40ca53ea77e440457c6d0f3832ec3b6286bacdf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125770
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 01:09:24 +00:00
Konstantin Shcheglov be519e83b1 Remove XyzElementImpl.forNode() constructors.
R=brianwilkerson@google.com

Change-Id: I39332a153b6d13be7b33d3980263eb3c3e952c65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125802
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-20 22:48:43 +00:00
Brian Wilkerson 1f933abcee Convert a compile time error into a parse error (issue 39389)
Change-Id: I115c7bb4ab05f8c6e9ddc566985126a1b9a09842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-19 18:25:29 +00:00
Konstantin Shcheglov 0a98a7a153 Add helper predicates for upper/lower bounds.
Change-Id: Icec2315e4a65539861d99c8e10e254d11454cba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-19 02:48:23 +00:00
Konstantin Shcheglov 239e2eb4ed Issue 38813. If in a legacy library, use legacy interface types for CONFLICTING_GENERIC_INTERFACES.
Bug: https://github.com/dart-lang/sdk/issues/38813
Change-Id: I950bf7bf492e80bc8f12c94252af360158dcb7b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125549
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-19 02:46:23 +00:00
Kallen Tu 2416116208 [analyzer] Support AST variance in visitors and cloning methods.
Most of the visitor, clone and constructor methods support variance
in the AST. Some methods for summary work are missing from this CL,
but I have taken note and will change those in an analyzer summary CL
in the future.

Change-Id: I54a39b9ec44ced26d2bc55966d5938a91ab6a76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125007
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 23:20:53 +00:00
Konstantin Shcheglov a8bf0dc2e5 Move type parameter variance tests for LUB to LeastUpperBoundTest.
Change-Id: Ia1eda9f0be073043399488af43f9d0485656ceb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125563
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 22:25:00 +00:00
Konstantin Shcheglov 860132c9e0 Fix using interfaceType() without nullability, remove unused class.
R=brianwilkerson@google.com

Change-Id: I8c8ab46dc629e9a6895fdd37abc98d86e01590cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 19:10:01 +00:00
Konstantin Shcheglov 7df44023f4 Issue 38878. Update SuperContext for annotations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38878
Change-Id: Ib2944fd60062fca0ec2899d83656cdc02b0a4a87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125529
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 19:06:48 +00:00
Konstantin Shcheglov b5b45ffe4b Issue 38953. Exit the unit element walker on enter into a directive.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38953
Change-Id: I54e84e28f5d576bcd50c8bb10e99aefdae725c25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125528
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 18:11:53 +00:00
Konstantin Shcheglov aa0cf44b05 Issue 38506. Don't attempt to use LibraryElement.metadata for not the first LibraryDirective.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38506
Change-Id: Ib76b1e81554f061622ec98fae21b4dd9a1280c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:28:45 +00:00
Kallen Tu 6ec813e07a [analyzer] Modified type inference constraints wrt variance.
Change-Id: I0502bad1c57af358453c78d27fe738880beb7b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125021
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-15 22:02:36 +00:00
Konstantin Shcheglov 385cfb61c6 Add nullability variants to create InterfaceType(s) to ElementsTypesMixin.
R=brianwilkerson@google.com

Change-Id: I6ec6f6f1d533de4ec46e569c0b7becc9dd19b33b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125225
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-14 20:36:29 +00:00
Konstantin Shcheglov 81da345035 Use ElementsTypesMixin.mixin_ in analyzer tests.
R=brianwilkerson@google.com

Change-Id: I2e7dfc608db1f8fe66c48b94b4faf73be5344cb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-14 18:23:31 +00:00
Konstantin Shcheglov fac27eae0a Use Member(s) as legacy views on elements.
Change-Id: I3e8a603a50ecc04b217311bfc34f66e3dd924247
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124593
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-14 16:41:51 +00:00
Konstantin Shcheglov a8e48405dd Share search methods in FindElement and ImportFindElement.
Change-Id: I511c23440fbd95b3a27a50d7b80c66c9a8a7f558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:22:25 +00:00
Konstantin Shcheglov c9ef7cc5e3 Deprecate Member.baseElement, use Element.declaration in analyzer.
Change-Id: I91d23558c7d0bd8ffa2e251e5d615d4e026923b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124940
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:35:07 +00:00
Kallen Tu d5d889668b [analyzer] Added variance support for upper/lower bounds.
Change-Id: I64f44a7068c6caa222787ccb7dfbb3ed8b5fd0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124420
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-12 22:10:56 +00:00
Kallen Tu a65aff122d [analyzer] Changed subtype checking for variance modifiers.
Change-Id: I9fa65e13d2f8611acc50fd133029c76666b8f452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123559
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:09:56 +00:00
Konstantin Shcheglov 6cde7ce224 Deprecate synthetic FunctionTypeImpl constructor.
Change-Id: I7c2f834d7e9e532709b3d43b348e7588be659af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124595
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-11 19:38:53 +00:00
Konstantin Shcheglov dc69edcdb3 NullabilityEliminator for removing nullabilities in legacy libraries.
Change-Id: I3202ef39954e27b26a5851f449903fa1fac1eb63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 19:10:09 +00:00
Konstantin Shcheglov 7a45228584 Use ElementsTypesMixin in TypeSystem tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If7195af4f5e90e6acce60912f1c66c5cf956865c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 04:00:06 +00:00
Konstantin Shcheglov 1ab6ba98d3 Test GLB and LUB symmetry for FunctionType(s).
https://github.com/dart-lang/sdk/issues/26126 was fixed,
so we can do this properly now.

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

Change-Id: I938df344a96470f461f8d7f4cf530bc0b290453c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-07 21:51:17 +00:00
Kallen Tu 126297befd [analyzer] Add variance modifier values to the AST.
Change-Id: Ic8b4291941d7b11672783a5e11a741c90fb12394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123548
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-07 01:33:53 +00:00
Konstantin Shcheglov 3dacbae99e Use 'isRequiredNamed' for FunctionType subtyping.
Change-Id: I3d8ca70be7f782e1574535e463f9049ddd0e28a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124285
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-07 00:17:53 +00:00
Konstantin Shcheglov 89dd099cad Update TypeParameterElement.== as discussed, add tests.
Change-Id: I53e0f36bb3f11875a220f457f4c2205eae8ef2ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-06 18:32:13 +00:00
Mike Fairhurst 7ba5584c2e [analysis_server] Fix outdated desin Service->Server, use Service->Logger.
Also multiplex the service rather than the logger, so that we can
multiplex a crash reporting instrumentation service with a file logging
instrumentation service.

Change-Id: I7720c55e26225c27d2d9447a0156b2ca83da6598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122100
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-04 21:31:26 +00:00
Sam Rawlins 48d44af154 Report error if inheriting from FutureOr. Fixes #33745
Change-Id: Ia78892e48c6268d944cfb8f5b4afd25f37c95b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123883
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-04 16:32:26 +00:00
Paul Berry b3ed442f70 Fix some unnecessary imports of front_end in analyzer
Change-Id: I9d45dffffafca7799055b3db165200c2a8454537
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123841
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 13:54:22 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Mike Fairhurst 924ec34e01 Remove analysis logger, replace with calls to InstrumentationService
Change-Id: Ifddd58b731aa0af8f76a91261757997dc52a9fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123328
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-31 21:26:44 +00:00
Konstantin Shcheglov bb45179cad Remove tests already moved to ImplicitThisReferenceInInitializerTest.
R=brianwilkerson@google.com

Change-Id: Ibaf67be1bea844e10e599aad8b4ebc450e54cac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-31 18:14:33 +00:00
Paul Berry 5b4612bc68 Move front_end/lib/src/base/errors.dart into _fe_analyzer_shared package.
Change-Id: I9369e8dbf7b5d6fff9ad2a74346871b3e274e8ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123640
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-31 13:05:53 +00:00
Konstantin Shcheglov decca61f8c Deprecate TypeDefiningElement.type except ExecutableElement.
Change-Id: I7888f7ff796f1c4523cdc7030451dfc3ab622970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122729
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-31 05:09:13 +00:00
Konstantin Shcheglov e01ba33faf Remove CompilationUnitElementImpl.localDeclarations
Change-Id: I8c283d7997a26093dff6909a396ec0dee6d13c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123469
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-30 18:54:08 +00:00
Konstantin Shcheglov 4a07d80178 Deprecate ParameterizedType.typeParameters, update typeArguments doc.
Change-Id: I76c02e026c6c566def4f33478ef18f7df9d1d96e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123323
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-29 17:39:59 +00:00
Johnni Winther c8ff1b0c21 [cfe] Add BlockKind to parse/begin/endBlock
... and use this to computed AssignedVariables data for try statements

Change-Id: I235575b055cb89b553baf0ac728d9954d8d0aaa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123251
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-29 09:17:06 +00:00
Konstantin Shcheglov 581b959423 Remove methods _typeOfExecutableElement().
Change-Id: I61ddceefe214176361727482e4044a59d656d581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-28 15:40:02 +00:00
Konstantin Shcheglov bad583a9fc Always provide nullability suffix to FunctionType constructor.
Bug: https://github.com/dart-lang/sdk/issues/39111
Change-Id: Id91a5c3f559446fbbcc02d6f9465780d287deb29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123020
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-25 18:53:46 +00:00
Konstantin Shcheglov 70b1cedd87 Use NNBD subtyping rules.
https://github.com/dart-lang/language/blob/master/resources/type-system/subtyping.md#rules

This includes subtyping tests ported from CFE.

Performance is on par with the performance before this changes.
On package:flutter, when each isSubtypeOf() is executed 100 times,
timings are 35292 ms vs. 33838 ms spent on isSubtypeOf() itself
(not the whole analysis times). So, the difference is about 5%,
but because it is 100x, it should result in less than 0.05% of total
analysis time difference.

There are other optimizations that we can make in this area, though.
For example checking for `Object?` could be done using identical() to
avoid expensive megamorphic (I think) `isDartCoreObject`. Similarly
for checks for `Null` and `FutureOr`.

Google3 presubmit looks green.
https://test.corp.google.com/ui#id=OCL:276348418:BASE:276562990:1571960231050:ff94b8d8

Change-Id: I0b7e5baba82908e1123783c4a9494b1dfc74ea99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122682
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-25 17:50:06 +00:00
Konstantin Shcheglov 80b0aaf9b8 Deprecate FunctionTypeAliasElement.instantiate2(), replace with instantiate().
Change-Id: Iead94143fb3d02536309e464039493981cf853d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122965
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-25 14:38:50 +00:00
Sam Rawlins 9cc57416be Change error node for MISSING_RETURN to be the name
Fixes #35607

Change-Id: I66b9921b0ede5370364b89a89fb19bf0df96ac97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122726
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-24 19:42:07 +00:00
Konstantin Shcheglov 8b1e73d15d Remove lazy FunctionTypeImpl.
Change-Id: I9dad79468560f1b4c4be793ba51105acf19f05d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122721
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-24 17:27:32 +00:00
Konstantin Shcheglov 159e0b74bc Remove SourceContainer, Source_ContentReceiver.
Change-Id: I6e801382605d412f1f24d09ee58009c249439d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122300
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-10-22 05:28:28 +00:00
Sam Rawlins 66ceec0e3d Fix redirecting constructor const check
Fixes #27617

Change-Id: Id8629354e844d3f265302eda6348afccc2d63be1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122120
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-21 21:22:18 +00:00
Paul Berry 5d4cd6d589 Breaking changes for analyzer version 0.39.
Change-Id: Ifa9ca24487f93f3eb0ec95eeb64f5bbb5aa32714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113216
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-21 18:23:10 +00:00
Konstantin Shcheglov 9fe78bc9a8 Support for 'question' in FieldFormalParameter.
So, with 'question' token in AST, we can finish fixing the issue.

Bug: https://github.com/dart-lang/sdk/issues/38811
Change-Id: I9997be57c891c99c85dbfe3ef85871043fd3bffe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121884
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-16 23:04:56 +00:00
Konstantin Shcheglov 0649cb7755 Issue 38900. Fix type parameter type NonNull promotion.
Bug: https://github.com/dart-lang/sdk/issues/38900
Change-Id: If4373ebe6a35c83d07e8ebbac13bd0e00761f806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121881
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-16 21:21:45 +00:00
Konstantin Shcheglov 41bc899b56 Check for implicit cast using computeVariance().
This drops the optimization for Never.

Change-Id: I2f77e385559d8e1c278711f225a6d7e643577e9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121764
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-16 21:15:31 +00:00