Simn / haxe

6 stars 0 forks source link

Unify call args rewrite #31

Closed waneck closed 10 years ago

waneck commented 10 years ago

It's still not perfect. There are two problems: On the Java target, the unit tests cannot compile with the following error:

/usr/lib/haxe/std/java/_std/haxe/ds/WeakMap.hx:409: characters 11-18 : java.lang.ref.WeakReference.T should be haxe.ds.WeakMap.K

It seems that this comes from WeakReference::get() being seen as returning T, not K. This seems to come from an inversion of parameters somewhere. See the private class Entry.

On the C# target, it fails at runtime because it can't find _IndexOf. _IndexOf is a static function which later had its name changed to IndexOf with the @:native metadata. It seems that the classfield at FStatic is a copy, since the cf_name change didn't propagate to that instance.

We'll talk better about those tomorrow! See ya

Simn commented 10 years ago

The C# issue worries me. We're making copies of class fields in a few places ({cf with ... }), but this obviously won't work if we start mutating fields afterwards. This seems to be a larger problem.

waneck commented 10 years ago

I can't go to IRC right now, but does these copies happen more than in the using case? ({cf with cf_overloads=}) We could probably make cf_overloads be a mutable field, mutate it and then mutate it back to its original. Not perfect, but may solve the issue

Simn commented 10 years ago

It happens in a few other places.

However, I fixed the Java bug and the problem went away. I'm not sure if that's only incidental though.