class Main {
static function main() {
var foo:tink.pure.Vector<Foo> = [];
var bar:tink.pure.Vector<Bar> = foo;
}
}
typedef Foo = {
final id:String;
final ?project:String;
}
typedef Bar = {
final id:String;
final createDate:Date;
}
The above code compiles but it should not.
If we replace Vector with Array we will get:
src/Main.hx:4: characters 3-28 : error: { id : String, createDate : Date } has no field project
src/Main.hx:4: characters 3-28 : ... have: Array<Foo>
src/Main.hx:4: characters 3-28 : ... want: Array<Bar>
The above code compiles but it should not.
If we replace Vector with Array we will get: