HaxeFoundation / HaxeFoundation/hxjava

Rest from Array doesn't work properly

Ouverte
#40 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Haxe
Étoiles
46
Forks
14
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

When creating an Array and populating it with push(), the Rest from it doesn't work correct - it adds null value at the end. The bug in --java and --jvm:

```Haxe
import haxe.Rest;

class Main {
static public function main() {
var a:Array = new Array();
a.push(1);
a.push(2);
a.push(3);
trace(a, a.length); // [1,2,3], 3
var r = Rest.of(a);
trace(r, r.length); // [1,2,3,null], 4
}
}
```

```
-cp src
-main Main
--each

--java bin/java
--next

--jvm bin/jvm/main.jar
--next

--interp
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with the haxe.Rest.of(a) path used by the --java and --jvm targets, reproducing the sample with the commands in the issue. Compare those results with --interp; done means Rest contains exactly the three pushed values and reports length 3 without the trailing null.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
backend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.