ethanblake4 / dart_eval

Extensible Dart interpreter for Dart with full interop
https://pub.dev/packages/dart_eval
BSD 3-Clause "New" or "Revised" License
334 stars 40 forks source link

type bool, but is initialized to an incompatible value of type int when using string.contains #131

Closed Noobware1 closed 1 year ago

Noobware1 commented 1 year ago

version - 0.7.0 trying to do bool isFillerEpisode = 'test'.contains("ssl-item-filler");

CompileError: Type mismatch: variable "isFillerEpisode is specified as type bool, but is initialized to an incompatible value of type int at unknown (file package:extenstions_test/main.dart)
#0      Compiler.compileSources (package:dart_eval/src/eval/compiler/compiler.dart:497:7)
#1      Compiler.compile (package:dart_eval/src/eval/compiler/compiler.dart:164:12)
#2      compilerEval (package:extenstions_test/extenstions_test.dart:80:28)
<asynchronous suspension>
#3      main (package:extenstions_test/extenstions_test.dart:179:20)
<asynchronous suspension>
ethanblake4 commented 1 year ago

Pushed a commit fixing this to v0.7 branch

ethanblake4 commented 1 year ago

Fixed in v0.7.0