Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing assertion in package:async: introduceAsType without introduceAsInfo (or the other way around) #40533

Closed
MichaelRFairhurst opened this issue Feb 7, 2020 · 1 comment
Assignees
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). NNBD Issues related to NNBD Release nnbd-migration-correctness-example Concrete examples of the migration engine producing an incorrect result on a phase 1 package type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@MichaelRFairhurst
Copy link
Contributor

Unclear if this is causing any static errors or not.

Unhandled exception:
'package:nnbd_migration/src/fix_aggregator.dart': Failed assertion: line 294 pos 12: '(introduceAsType == null) == (introduceAsInfo == null)': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)
#2      NodeChangeForExpression._applyExpression (package:nnbd_migration/src/fix_aggregator.dart:294:12)
#3      NodeChangeForExpression._apply (package:nnbd_migration/src/fix_aggregator.dart:286:12)
#4      FixAggregator.visitNode (package:nnbd_migration/src/fix_aggregator.dart:64:30)
#5      UnifyingAstVisitor.visitSimpleStringLiteral (package:analyzer/dart/ast/visitor.dart:3413:59)
#6      SimpleStringLiteralImpl.accept (package:analyzer/src/dart/ast/ast.dart:9011:49)
#7      YieldStatementImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:10747:18)
#8      FixAggregator.visitNode (package:nnbd_migration/src/fix_aggregator.dart:69:12)
#9      UnifyingAstVisitor.visitYieldStatement (package:analyzer/dart/ast/visitor.dart:3483:49)
#10     YieldStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:10743:49)
#11     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7525:20)
#12     BlockImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1085:17)
#13     FixAggregator.visitNode (package:nnbd_migration/src/fix_aggregator.dart:69:12)
#14     UnifyingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:3128:31)
#15     BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1081:49)
#16     BlockFunctionBodyImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1040:13)
#17     FixAggregator.visitNode (package:nnbd_migration/src/fix_aggregator.dart:69:12)
#18     UnifyingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:3131:55)
#19     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1036:49)
#20     FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4973:12)
@MichaelRFairhurst MichaelRFairhurst added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) analyzer-nnbd-migration NNBD Issues related to NNBD Release nnbd-migration-correctness-example Concrete examples of the migration engine producing an incorrect result on a phase 1 package labels Feb 7, 2020
@stereotype441
Copy link
Member

Investigating now

@stereotype441 stereotype441 self-assigned this Feb 7, 2020
dart-bot pushed a commit that referenced this issue Feb 10, 2020
…sync.

There were two problems:

1. An info object isn't being properly passed to
   NodeChangeForExpression, causing an assertion failure during the
   FixAggregator stage.  I've modified the assertion check so that it
   happens earlier, during the FixBuilder, so that the exception is
   caught by permissive mode logic and doesn't cause a hard crash.
   I'll work on fixing the assertion in a follow-up CL.

2. The hack described in #40536
   was causing a bogus assertion failure in
   _PassThroughBuilderImpl._checkParenLogic.  I've weakened the
   assertion slightly so that for now, the hack won't cause trouble.
   See the issue for more information about what's happening--this
   should be cleaned up eventually but it's probably not high
   priority.

Bug: #40533
Change-Id: Iee832fbd07e54b02d2c52f79a097ff9d973cda9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
@stereotype441 stereotype441 added area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). and removed analyzer-nnbd-migration area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). NNBD Issues related to NNBD Release nnbd-migration-correctness-example Concrete examples of the migration engine producing an incorrect result on a phase 1 package type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants