Open BenVercammen opened 10 months ago
Was an error with the example, will be updated in next release.
You can change the $new function in the $Book$bridge class to the following to fix:
static $Value? $new(
Runtime runtime, $Value? target, List<$Value?> args) {
return $Book$bridge((args[0]!.$reified as List).cast());
}
@ethanblake4 A new question.. I'd like to modify the list in the program
, but the new pages don't show up in the bridged class. I suppose that the problem lies in my $getProperty
method, but I'm not sure where to get the actual value from... Could you shed some light on this please?
That specific use case isn't really supported with the built-in $List class currently. I created an issue to track it. You could make a custom $List wrapper that supports writeback via a type-mapper function, but if you want to do this now I'd suggest just making an addPage function or similar.
This is now supported in v0.7.5 using the new $List.view()
constructor
@ethanblake4 Could you please have a look at this example? I've tried to reconstruct the Book bridge example from the
README.md
file, but get the following error:dart_eval runtime exception: type 'List<$Value>' is not a subtype of type 'List<String>'