Closed vijaymsc closed 1 week ago
import 'package:dart_eval/dart_eval.dart'; import 'package:dart_eval/stdlib/core.dart'; const program = ''' int main(List<dynamic> args) { print(args[0]); return args[0].length + args[1]; } '''; void main(){ print(eval(program, function: 'main', args: [[$String('vijay'),5]])); }
Error console
Unhandled exception: type 'int' is not a subtype of type '$Value?' in type cast
If you are using dynamic you must use $int.
$int
Error console
Unhandled exception: type 'int' is not a subtype of type '$Value?' in type cast
0 Runtime.execute (package:dart_eval/src/eval/runtime/runtime.dart:874:7)
1 Runtime.executeLib (package:dart_eval/src/eval/runtime/runtime.dart:854:12)
2 eval (package:dart_eval/src/eval/eval.dart:58:26)
3 main (package:flutter_dynamic_view/test.dart:59:9)
4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:297:19)
5 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)