Closed burekas7 closed 1 year ago
@burekas7 Did this happen when evaluation an explicit expression during debugging or when hovering expressions in the editor? Also was this part of a hot-reload cycle (i.e. was the code "recently" modified) ?
+1 , got same error when hovering on the expressions in VS CODE editor , using Dio package to debug the responses .
sdk: ">=2.19.2 <4.0.0"
flutter doctor `Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.13.2, on macOS 13.5 22G74 darwin-x64, locale en-EG) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.81.1) [✓] Connected device (3 available) [✓] Network resources
• No issues found!`
@heshesh2010 Do you have any idea what expression was?
same
+1 here having a similar issue :
List<List<int>> l = List.generate(list.length, (index) => []);
List<dynamic> guide = [
{
"field": null,
"nextList": null,
"selection": l,
"max_selected": 1000,
}
];
this generate a debugger crash :
Unhandled exception:
Invalid argument(s): Iterables do not have same length.
#0 MapBase._fillMapWithIterables (dart:collection/maps.dart:178:7)
#1 new LinkedHashMap.fromIterables (dart:collection/linked_hash_map.dart:246:13)
#2 Substitution.fromPairs (package:kernel/type_algebra.dart:263:13)
#3 InferenceVisitorBase.getGetterTypeForMemberTarget (package:front_end/src/fasta/type_inference/inference_visitor_base.dart:1465:35)
This seems to originate from a bad encoding of the arguments passed to the expression compiler - at least I can recreate the crash by creating such a bad message. I'm still not still sure the where in the tool chain this encoding is created, though.
Likely related to https://github.com/dart-lang/sdk/issues/53382
cc @jensjoha
@jensjoha @mraleph Can we be sure that a raw type of a generic class in the VM has the right number of types arguments? I.e. could the VM be creating the encoding ["dart:core", "List", "1", "0"]
for List
in CollectStringifiedType
?
@johnniwinther I think they should have correct length. Type
object in the VM should carry TAV which matches the number of type parameters the class has (cc @alexmarkov)
However the code in CollectStringifiedType
is a bit suspicious - it does not seem to handle raw types (e.g. List<dynamic>
) correctly. VM used to denote those using null
TAV and CollectStringifiedType
does not seem to handle that at all. Maybe we can try to reproduce by trying expression compilation in a context with a variable which has a raw type, e.g. final v = <dynamic>[]
and see if it blows up?
Yeah it reproduces quite trivially with the following test:
And if I put RELEASE_ASSERT(!srcArguments.IsNull());
it triggers. The fix should be fairly trivial - just handle this case. I can patch it up.
In my case i was having this problem using for each to desserialize a json response that was inside a list, when a change it to a "for in" it stopped to crash
Does anyone know if this bug was fixed? Because I see this issue is closed.
Should I need to update the dart sdk version?
@mraleph @johnniwinther
The issue has been fixed in the Dart repository and is available in the lastest dev release. It will be in the the next beta and stable releases.
@johnniwinther I see you said this 3 weeks ago, so I made sure to update to new flutter & dart versions released after your comment.
(@mraleph tagging you as you authored the fix 3 weeks ago)
I still experience this issue with these updates that were released sept 27th (about 2 weeks after your comment).
flutter: 3.13.6
dart: 3.1.3
environment: sdk: '>=3.1.3 <4.0.0'
Unhandled exception:
Invalid argument(s): Iterables do not have same length.
#0 MapBase._fillMapWithIterables (dart:collection/maps.dart:178:7)
#1 new LinkedHashMap.fromIterables (dart:collection/linked_hash_map.dart:246:13)
#2 Substitution.fromPairs (package:kernel/type_algebra.dart:263:13)
#3 InferenceVisitorBase.getGetterTypeForMemberTarget (package:front_end/src/fasta/type_inference/inference_visitor_base.dart:1465:35)
#5 InferenceVisitorImpl._computePropertyGet (package:front_end/src/fasta/type_inference/inference_visitor.dart:6663:36)
#4 InstanceAccessTarget.getGetterType (package:front_end/src/fasta/type_inference/object_access_target.dart:489:30)
#6 InferenceVisitorImpl.visitPropertyGet (package:front_end/src/fasta/type_inference/inference_visitor.dart:7672:61)
#7 PropertyGet.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:2984:20)
#8 InferenceVisitorImpl._inferExpression (package:front_end/src/fasta/type_inference/inference_visitor.dart:257:27)
#9 InferenceVisitorImpl.inferExpression (package:front_end/src/fasta/type_inference/inference_visitor.dart:291:40)
#10 InferenceVisitorImpl.visitReturnStatement (package:front_end/src/fasta/type_inference/inference_visitor.dart:7894:11)
#11 ReturnStatement.accept (package:kernel/ast.dart:10127:43)
#12 InferenceVisitorImpl.inferStatement (package:front_end/src/fasta/type_inference/inference_visitor.dart:242:26)
#13 TypeInferrerImpl.inferFunctionBody (package:front_end/src/fasta/type_inference/type_inferrer.dart:198:17)
#14 BodyBuilder.parseSingleExpression (package:front_end/src/fasta/kernel/body_builder.dart:1780:62)
#15 SourceLoader.buildExpression (package:front_end/src/fasta/source/source_loader.dart:1320:21)
<asynchronous suspension>
#16 IncrementalCompiler.compileExpression.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:2033:39)
<asynchronous suspension>
#17 IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:1853:12)
<asynchronous suspension>
#18 FrontendCompiler.compileExpression (package:frontend_server/frontend_server.dart:981:28)
<asynchronous suspension>
#19 listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1452:11)
<asynchronous suspension>
It seems you're on flutter stable meaning you don't get the dev releases of dart.
It seems you're on flutter stable meaning you don't get the dev releases of dart.
As was mentioned above, It will be in the the next beta and stable releases.
. I do see that that doesn't specify which next stable release though...
@shawnAshton next stable release means Dart 3.2.
It seems you're on flutter stable meaning you don't get the dev releases of dart.
As was mentioned above,
It will be in the next beta and stable releases.
. I do see that that doesn't specify which next stable release though...
@shawnAshton @mraleph Please push the latest release on the stable branch. I am stuck nothing is working, my timelines are disturbed because of this error.
@kashiflab Agree. It is completely difficult to debug api calls like this, I put a breakpoint and a few seconds later it crashes the application and debug.
When the stable release with the fix will be ready for use? @mraleph @johnniwinther
Stable release is in the final rounds of testing and preparations for release. You could switch to Flutter beta channel if you want the fix already today.
I bring good news guys, today I was looking for the problem and came across this topic. The new version of flutter (3.16.0) released yesterday has fixed the problem.
Flutter 3.13.2 environment: sdk: '>=3.1.0 <4.0.0'
After a specific dio 'post' call I'm getting this error: