haxetink / tink_pure

Pure immutable data.
MIT License
10 stars 7 forks source link

Cannot unify final and non-final fields when using Vector #25

Open serjek opened 1 year ago

serjek commented 1 year ago

Haxe 4.2.5

var data:tink.pure.Vector<{final whatever:Int;}> = tink.pure.Vector.fromArray([{whatever:42}]);

this gives following compilation error:

src/MainClient.hx:31: characters 47-90 : error: Cannot unify final and non-final fields
src/MainClient.hx:31: characters 47-90 : ... have: tink.pure.Vector<{ whatever: Dynamic }>
src/MainClient.hx:31: characters 47-90 : ... want: tink.pure.Vector<{ whatever: Dynamic }>
src/MainClient.hx:31: characters 47-90 : ... For function argument 'compute'
src/MainClient.hx:31: characters 47-90 : ... For function argument 'fn'

Using List instead of Vector fixes the problem.