-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[hl] add element type to HArray #11734
Conversation
The problem is that the function returned by haxe/src/generators/hlinterp.ml Line 2233 in b537e99
|
Ah right, there's a lookup involved... thank you for pointing me in the right direction! For now I've fixed this by adding an The failures in TestInt64 remain and are likely going to be more of a headache. |
Looks like it doesn't like arrays of Int64. Lines 3160 to 3168 in d033cdb
The solution is probably to turn Array<Int64> into ArrayBytes<Int64> instead of ArrayObj.
|
* [hl] Add specialized Array implementation for I64. * [hlc] Fix HArray type generation.
@yuxiaomao Checking this one would be good as well. I'm not very confident regarding anything HL-related. |
|
I've factored out all occurrences of |
Here's a repro: import hl.NativeArray;
function main() {
var a = new hl.NativeArray<Float>(1);
a[0] = 0.0;
var b:NativeArray<Float> = new hl.NativeArray<Float>(1);
b[0] = 1.0;
foo(a, b, 1);
trace(a[0]);
}
The problem here is that A solution is to wrap blit like this: @:hlNative("std", "array_blit") static function real_blit(dest:NativeArray<Any>, pos:Int, src:NativeArray<Any>, srcPos:Int, srcLen:Int):Void {}
public inline function blit(pos:Int, src:NativeArray<T>, srcPos:Int, srcLen:Int):Void {
real_blit(cast this, pos, cast src, srcPos, srcLen);
} |
Thanks! That does look a bit funky but it indeed seems to work. |
Seems good now for Shiro's project. |
Thank you for checking! |
Seems causing hl/jit cmake 32bit on windows failed (that's very wired and I don't understand). |
This changes HL's
HArray
to carry an element type, which I want to use to deal with the problems described in #11568.At the moment we're getting some hl-check failures in the unit tests that all look like this:
I suspect that there's some bad typing going on here involving unapplied type parameters, which lead to the unwanted
array(dyn)
.Compiling a standalone
on the other hand gives some very suspicious errors like these:
I currently have no idea where the
array(i32)
comes from. The dump looks normal:Note how all occurrences of
hl.NativeArray
havehaxe.Symbol
as type parameter. This makes me think that there's an unrelated bug in genhl here.