ethanblake4 / dart_eval

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

Utf8Codec.encode has incorrect return type #209

Open anlumo opened 4 months ago

anlumo commented 4 months ago

https://github.com/ethanblake4/dart_eval/blob/b06ed0de64bf1c494f07497fec1e4e8a59f02854/lib/src/eval/shared/stdlib/convert/utf.dart#L89-L91

This function returns a Uint8List, not a List<int>: https://api.flutter.dev/flutter/dart-convert/Utf8Codec/encode.html

ethanblake4 commented 3 months ago

I believe this was done on purpose to work around some kind of issue in dart_eval, although I can't really remember now what it was. I'll try to write some tests and see if updates to dart_eval have made doing this correctly possible