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

Crash when compiling: Unsupported operation: moretop #49515

Closed
0styx0 opened this issue Jul 24, 2022 · 1 comment
Closed

Crash when compiling: Unsupported operation: moretop #49515

0styx0 opened this issue Jul 24, 2022 · 1 comment
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@0styx0
Copy link

0styx0 commented Jul 24, 2022

$ dart --version
Dart SDK version: 2.17.6 (stable) (Tue Jul 12 12:54:37 2022 +0200) on "linux_x64"
  • Whether you are using Windows, MacOSX, or Linux (if applicable)
    • Arch Linux. Doubt it's applicable.
  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable)
    • Not applicable

Issue:

Crash when compiling...Unsupported operation: moretop
Unhandled exception:
Crash when compiling file:///path/to/file.dart,
at character offset 6358:
Unsupported operation: moretop(FutureOrType(FutureOr%), FutureOrType(FutureOr))
#0      StandardBounds.moretop (package:kernel/src/standard_bounds.dart:124:5)
#1      StandardBounds.getNullabilityAwareStandardLowerBoundInternal (package:kernel/src/standard_bounds.dart:280:42)
#2      TypeSchemaStandardBounds.getNullabilityAwareStandardLowerBoundInternal
(package:front_end/src/fasta/type_inference/standard_bounds.dart:27:18)
#3      StandardBounds._getNullabilityAwareStandardLowerBound (package:kernel/src/standard_bounds.dart:264:12)
#4      StandardBounds.getStandardLowerBound (package:kernel/src/standard_bounds.dart:252:14)
#5      TypeSchemaEnvironment.addUpperBound (package:front_end/src/fasta/type_inference/type_schema_environment.dart:123:9)
#6      TypeSchemaConstraintGatherer.addUpperBound
(package:front_end/src/fasta/type_inference/type_constraint_gatherer.dart:1049:17)
#7      TypeConstraintGatherer.computeConstraints
(package:front_end/src/fasta/type_inference/type_constraint_gatherer.dart:67:9)
#8      TypeSchemaEnvironment.inferGenericFunctionOrType
(package:front_end/src/fasta/type_inference/type_schema_environment.dart:290:39)
#9      TypeInferrerImpl._inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2583:29)
#10     TypeInferrerImpl.inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2155:12)
#11     TypeInferrerImpl._inferInstanceMethodInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:3295:40)
#12     TypeInferrerImpl.inferMethodInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:3832:20)
#13     InferenceVisitor.visitMethodInvocation (package:front_end/src/fasta/kernel/inference_visitor.dart:2909:21)
#14     MethodInvocation.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:4644:20)
#15     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2030:27)
#16     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
#17     InferenceVisitor.visitReturnStatement (package:front_end/src/fasta/kernel/inference_visitor.dart:5947:61)
#18     ReturnStatement.accept (package:kernel/ast.dart:9864:43)
#19     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
#20     TypeInferrerImpl.inferLocalFunction (package:front_end/src/fasta/type_inference/type_inferrer.dart:2861:43)
#21     InferenceVisitor.visitFunctionNode (package:front_end/src/fasta/kernel/inference_visitor.dart:1380:21)
#22     InferenceVisitor.visitFunctionExpression (package:front_end/src/fasta/kernel/inference_visitor.dart:1411:9)
#23     FunctionExpression.accept1 (package:kernel/ast.dart:8283:9)
#24     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2032:27)
#25     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
#26     TypeInferrerImpl._inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2428:46)
#27     TypeInferrerImpl.inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2155:12)
#28     TypeInferrerImpl._inferInstanceMethodInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:3295:40)
#29     TypeInferrerImpl.inferMethodInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:3832:20)
#30     InferenceVisitor.visitMethodInvocation (package:front_end/src/fasta/kernel/inference_visitor.dart:2909:21)
#31     MethodInvocation.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:4644:20)
#32     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2030:27)
#33     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
#34     InferenceVisitor.visitExpressionStatement (package:front_end/src/fasta/kernel/inference_visitor.dart:981:49)
#35     ExpressionStatement.accept (package:kernel/ast.dart:8829:43)
#36     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
#37     InferenceVisitor._visitStatements (package:front_end/src/fasta/kernel/inference_visitor.dart:542:20)
#38     InferenceVisitor.visitBlock (package:front_end/src/fasta/kernel/inference_visitor.dart:563:31)
#39     Block.accept (package:kernel/ast.dart:8885:43)
#40     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
#41     TypeInferrerImpl.inferFunctionBody (package:front_end/src/fasta/type_inference/type_inferrer.dart:2112:39)
#42     BodyBuilder.finishFunction (package:front_end/src/fasta/kernel/body_builder.dart:1267:43)
#43     DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:1074:19)
#44     DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:722:5)
#45     DietListener.endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:661:5)
#46     Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4425:20)
#47     Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4139:15)
#48     Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3784:15)
#49     Parser.parseClass (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2248:13)
#50     Parser.parseClassOrNamedMixinApplication (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2206:14)
#51     Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:564:14)
#52     Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:497:14)
#53     Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:377:15)
#54     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:1162:12)

#55     SourceLoader.buildBodies (package:front_end/src/fasta/source/source_loader.dart:661:7)

#56     KernelTarget.buildComponent. (package:front_end/src/fasta/kernel/kernel_target.dart:615:7)

#57     withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)

#58     IncrementalCompiler.computeDelta. (package:front_end/src/fasta/incremental_compiler.dart:405:23)

#59     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:68:50)

#60     FrontendCompiler.compile (file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:562:11)

#61     listenAndCompile.
(file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:1199:11)

#0 DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:1078:7)
#1 DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:722:5)
#2 DietListener.endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:661:5)
#3 Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4425:20)
#4 Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4139:15)
#5 Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3784:15)
#6 Parser.parseClass (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2248:13)
#7 Parser.parseClassOrNamedMixinApplication (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2206:14)
#8 Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:564:14)
#9 Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:497:14)
#10 Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:377:15)
#11 SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:1162:12)

#12 SourceLoader.buildBodies (package:front_end/src/fasta/source/source_loader.dart:661:7)

#13 KernelTarget.buildComponent. (package:front_end/src/fasta/kernel/kernel_target.dart:615:7)

#14 withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)

#15 IncrementalCompiler.computeDelta. (package:front_end/src/fasta/incremental_compiler.dart:405:23)

#16 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:68:50)

#17 FrontendCompiler.compile (file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:562:11)

#18 listenAndCompile.
(file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:1199:11)

the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.

Error with
run --verbose
[+1447 ms] Unhandled exception:
[   +2 ms] Crash when compiling file:///path/to/file.dart,
[        ] at character offset 6358:
[        ] Unsupported operation: moretop(FutureOrType(FutureOr%), FutureOrType(FutureOr))
[        ] #0      StandardBounds.moretop (package:kernel/src/standard_bounds.dart:124:5)
[        ] #1      StandardBounds.getNullabilityAwareStandardLowerBoundInternal
(package:kernel/src/standard_bounds.dart:280:42)
[        ] #2      TypeSchemaStandardBounds.getNullabilityAwareStandardLowerBoundInternal
           (package:front_end/src/fasta/type_inference/standard_bounds.dart:27:18)
[        ] #3      StandardBounds._getNullabilityAwareStandardLowerBound (package:kernel/src/standard_bounds.dart:264:12)
[        ] #4      StandardBounds.getStandardLowerBound (package:kernel/src/standard_bounds.dart:252:14)
[        ] #5      TypeSchemaEnvironment.addUpperBound
(package:front_end/src/fasta/type_inference/type_schema_environment.dart:123:9)
[        ] #6      TypeSchemaConstraintGatherer.addUpperBound
           (package:front_end/src/fasta/type_inference/type_constraint_gatherer.dart:1049:17)
[        ] #7      TypeConstraintGatherer.computeConstraints
           (package:front_end/src/fasta/type_inference/type_constraint_gatherer.dart:67:9)
[        ] #8      TypeSchemaEnvironment.inferGenericFunctionOrType
           (package:front_end/src/fasta/type_inference/type_schema_environment.dart:290:39)
[        ] #9      TypeInferrerImpl._inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2583:29)
[        ] #10     TypeInferrerImpl.inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2155:12)
[        ] #11     TypeInferrerImpl._inferInstanceMethodInvocation
(package:front_end/src/fasta/type_inference/type_inferrer.dart:3295:40)
[        ] #12     TypeInferrerImpl.inferMethodInvocation
(package:front_end/src/fasta/type_inference/type_inferrer.dart:3832:20)
[        ] #13     InferenceVisitor.visitMethodInvocation (package:front_end/src/fasta/kernel/inference_visitor.dart:2909:21)
[        ] #14     MethodInvocation.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:4644:20)
[        ] #15     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2030:27)
[        ] #16     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
[        ] #17     InferenceVisitor.visitReturnStatement (package:front_end/src/fasta/kernel/inference_visitor.dart:5947:61)
[        ] #18     ReturnStatement.accept (package:kernel/ast.dart:9864:43)
[        ] #19     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
[        ] #20     TypeInferrerImpl.inferLocalFunction (package:front_end/src/fasta/type_inference/type_inferrer.dart:2861:43)
[        ] #21     InferenceVisitor.visitFunctionNode (package:front_end/src/fasta/kernel/inference_visitor.dart:1380:21)
[        ] #22     InferenceVisitor.visitFunctionExpression (package:front_end/src/fasta/kernel/inference_visitor.dart:1411:9)
[        ] #23     FunctionExpression.accept1 (package:kernel/ast.dart:8283:9)
[        ] #24     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2032:27)
[        ] #25     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
[        ] #26     TypeInferrerImpl._inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2428:46)
[        ] #27     TypeInferrerImpl.inferInvocation (package:front_end/src/fasta/type_inference/type_inferrer.dart:2155:12)
[        ] #28     TypeInferrerImpl._inferInstanceMethodInvocation
(package:front_end/src/fasta/type_inference/type_inferrer.dart:3295:40)
[        ] #29     TypeInferrerImpl.inferMethodInvocation
(package:front_end/src/fasta/type_inference/type_inferrer.dart:3832:20)
[        ] #30     InferenceVisitor.visitMethodInvocation (package:front_end/src/fasta/kernel/inference_visitor.dart:2909:21)
[        ] #31     MethodInvocation.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:4644:20)
[        ] #32     TypeInferrerImpl._inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2030:27)
[        ] #33     TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:2067:40)
[        ] #34     InferenceVisitor.visitExpressionStatement (package:front_end/src/fasta/kernel/inference_visitor.dart:981:49)
[        ] #35     ExpressionStatement.accept (package:kernel/ast.dart:8829:43)
[        ] #36     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
[        ] #37     InferenceVisitor._visitStatements (package:front_end/src/fasta/kernel/inference_visitor.dart:542:20)
[        ] #38     InferenceVisitor.visitBlock (package:front_end/src/fasta/kernel/inference_visitor.dart:563:31)
[        ] #39     Block.accept (package:kernel/ast.dart:8885:43)
[        ] #40     TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:4115:24)
[        ] #41     TypeInferrerImpl.inferFunctionBody (package:front_end/src/fasta/type_inference/type_inferrer.dart:2112:39)
[        ] #42     BodyBuilder.finishFunction (package:front_end/src/fasta/kernel/body_builder.dart:1267:43)
[        ] #43     DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:1074:19)
[        ] #44     DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:722:5)
[        ] #45     DietListener.endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:661:5)
[        ] #46     Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4425:20)
[        ] #47     Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl
(package:_fe_analyzer_shared/src/parser/parser_impl.dart:4139:15)
[        ] #48     Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3784:15)
[        ] #49     Parser.parseClass (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2248:13)
[        ] #50     Parser.parseClassOrNamedMixinApplication (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2206:14)
[        ] #51     Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:564:14)
[        ] #52     Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:497:14)
[   +1 ms] #53     Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:377:15)
[        ] #54     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:1162:12)
[        ] 
[        ] #55     SourceLoader.buildBodies (package:front_end/src/fasta/source/source_loader.dart:661:7)
[        ] 
[        ] #56     KernelTarget.buildComponent.
(package:front_end/src/fasta/kernel/kernel_target.dart:615:7)
[        ] 
[        ] #57     withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
[        ] 
[        ] #58     IncrementalCompiler.computeDelta.
(package:front_end/src/fasta/incremental_compiler.dart:405:23)
[        ] 
[        ] #59     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:68:50)
[        ] 
[        ] #60     FrontendCompiler.compile
(file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:562:11)
[        ] 
[        ] #61     listenAndCompile.
           (file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:1199:11)
[        ] 
[        ] #0      DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:1078:7)
[        ] #1      DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:722:5)
[        ] #2      DietListener.endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:661:5)
[        ] #3      Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4425:20)
[        ] #4      Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl
(package:_fe_analyzer_shared/src/parser/parser_impl.dart:4139:15)
[        ] #5      Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3784:15)
[        ] #6      Parser.parseClass (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2248:13)
[        ] #7      Parser.parseClassOrNamedMixinApplication (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2206:14)
[        ] #8      Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:564:14)
[        ] #9      Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:497:14)
[        ] #10     Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:377:15)
[        ] #11     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:1162:12)
[        ] 
[        ] #12     SourceLoader.buildBodies (package:front_end/src/fasta/source/source_loader.dart:661:7)
[        ] 
[        ] #13     KernelTarget.buildComponent.
(package:front_end/src/fasta/kernel/kernel_target.dart:615:7)
[        ] 
[        ] #14     withCrashReporting (package:front_end/src/fasta/crash.dart:122:12)
[        ] 
[        ] #15     IncrementalCompiler.computeDelta.
(package:front_end/src/fasta/incremental_compiler.dart:405:23)
[        ] 
[        ] #16     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:68:50)
[        ] 
[        ] #17     FrontendCompiler.compile
(file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:562:11)
[        ] 
[        ] #18     listenAndCompile.
           (file:///b/s/w/ir/cache/builder/sdk/pkg/frontend_server/lib/frontend_server.dart:1199:11)
[        ] 
[ +121 ms] the Dart compiler exited unexpectedly.
[        ]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      DefaultResidentCompiler._compile. (package:flutter_tools/src/compile.dart:804:13)
           #2      _rootRun (dart:async/zone.dart:1418:47)
           #3      _CustomZone.run (dart:async/zone.dart:1328:19)
           #4      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
           #5      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
           #6      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
           #7      _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
           #8      _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
           #9      _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
           #10     _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
           #11     _LineSplitterSink.close (dart:convert/line_splitter.dart:154:11)
           #12     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
           #13     _rootRun (dart:async/zone.dart:1418:47)
           #14     _CustomZone.run (dart:async/zone.dart:1328:19)
           #15     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
           #16     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
           #17     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
           #18     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
           #19     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
           #20     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
           #21     _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
           #22     _Utf8ConversionSink.close (dart:convert/string_conversion.dart:305:20)
           #23     _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:81:18)
           #24     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
           #25     _rootRun (dart:async/zone.dart:1418:47)
           #26     _CustomZone.run (dart:async/zone.dart:1328:19)
           #27     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
           #28     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
           #29     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
           #30     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
           #31     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:782:19)
           #32     _StreamController._closeUnchecked (dart:async/stream_controller.dart:637:7)
           #33     _StreamController.close (dart:async/stream_controller.dart:630:5)
           #34     _Socket._onData (dart:io-patch/socket_patch.dart:2321:21)
           #35     _rootRunUnary (dart:async/zone.dart:1442:13)
           #36     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
           #37     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
           #38     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
           #39     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
           #40     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
           #41     _StreamController._add (dart:async/stream_controller.dart:648:7)
           #42     _StreamController.add (dart:async/stream_controller.dart:596:5)
           #43     new _RawSocket. (dart:io-patch/socket_patch.dart:1846:35)
           #44     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1315:18)
           #45     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
           #46     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
           #47     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
           #48     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)

[ +2 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ +1 ms] the Dart compiler exited unexpectedly.
[ +1 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 DefaultResidentCompiler._compile. (package:flutter_tools/src/compile.dart:804:13)
#2 _rootRun (dart:async/zone.dart:1418:47)
#3 _CustomZone.run (dart:async/zone.dart:1328:19)
#4 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#5 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
#6 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
#7 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#8 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#9 _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#10 _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#11 _LineSplitterSink.close (dart:convert/line_splitter.dart:154:11)
#12 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#13 _rootRun (dart:async/zone.dart:1418:47)
#14 _CustomZone.run (dart:async/zone.dart:1328:19)
#15 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#16 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
#17 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
#18 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#19 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#20 _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#21 _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#22 _Utf8ConversionSink.close (dart:convert/string_conversion.dart:305:20)
#23 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:81:18)
#24 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#25 _rootRun (dart:async/zone.dart:1418:47)
#26 _CustomZone.run (dart:async/zone.dart:1328:19)
#27 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#28 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:394:13)
#29 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:404:7)
#30 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#31 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:782:19)
#32 _StreamController._closeUnchecked (dart:async/stream_controller.dart:637:7)
#33 _StreamController.close (dart:async/stream_controller.dart:630:5)
#34 _Socket._onData (dart:io-patch/socket_patch.dart:2321:21)
#35 _rootRunUnary (dart:async/zone.dart:1442:13)
#36 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#37 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#38 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#39 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#40 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#41 _StreamController._add (dart:async/stream_controller.dart:648:7)
#42 _StreamController.add (dart:async/stream_controller.dart:596:5)
#43 new _RawSocket. (dart:io-patch/socket_patch.dart:1846:35)
#44 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1315:18)
#45 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#46 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#47 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#48 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)

[ +1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1

Minimal reproducible example

Future.wait([])
  .then((list) =>
    list.fold([], (_, __) => [])
  );

Edit: Even more minimal example:

Future.value([])
  .then((list) => list.fold([], (_, __) => []));

Expected behavior: return an empty list wrapped in a future.


Note: Using methods other than fold does not produce the bug. eg,

Future.value([]).then((list) => list.map((_) => []));

compiles without error.


Problem happens both when running flutter test and flutter run

Potentially related issue: #47799

@lrhn lrhn added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel labels Jul 25, 2022
@johnniwinther johnniwinther added the P2 A bug or feature request we're likely to work on label Jul 25, 2022
@chloestefantsova
Copy link
Contributor

It appears to be fixed in 3d27f5c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants