Generic inline functions are treated as dynamic and crashes when used on maps

Abierto
#1,007 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c
Área
compilers

Línea de trabajo

Reproduce with lime test hl -debug -Dhl-check using the generic inline makeSpriteFrom<T:Level> from LDTKBackdrop.hx:23, then reduce it to a minimal Haxe file. The failure comes from the HashLink bytecode checker ("Register 10(dyn) should be object"), so start in this C repo's checker code and the Haxe-to-HL generator that emits the call. Done when the minimal case passes the hl check with the generic inline kept intact.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

haxe version: 4.3.7

i have something similar to

var myMap = new Map<String, Sprite>();

for (level in levels)
    myMap.set(level.identifier, makeSpriteFrom(level));

inline function makeSpriteFrom<T:Level>(level:T):Sprite
    return new Sprite(...);

in my code, and for lime on native targets it compiles fine (linux, etc). but for hashlink specifically it errors out

❯ lime test hl -debug -Dhl-check
 ERROR  (unknown position)

   | Error: 
   | levels/loader/parts/LDTKBackdrop.hx:23: Check failure at fun@5689 @1A - Register 10(dyn) should be object

unless i remove the inline from makeSpriteFrom().

it isnt as critical of a bug but its weird that it works on native targets but not hashlink

Lenguaje dominante
C
Estrellas
911
Forks
207
Merge medio
1 d 21 h
PR fusionados (30 d)
13

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HaxeFoundation/hashlink

Todos los issues de HaxeFoundation/hashlink

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.