HaxeFoundation / HaxeFoundation/haxe

"Implicit cast from I64 to Int (32 bits) is deprecated" has a wrong position with inline functions.

Open
#12,186 4 comments 0 reactions 1 assignee Claimed by @Simn View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

In this snippet: ([try haxe](https://try.haxe.org/#e3b1F767))

```haxe
inline function pos(): hl.I64 {
return 0;
}
inline function getAt(ret: hl.I64, pos: Int): hl.I64 {
return pos;
}

inline function flipX(v: hl.I64) {
var ret: hl.I64 = 0;
ret += getAt(v, pos());
return ret;
}
var sing: hl.I64 = 5;
var flipedx = flipX(sing);
```
You get the warning `Implicit cast from I64 to Int (32 bits) is deprecated. Use .toInt() or explicitly cast instead.` on the `flipX(sing)` call. Removing the inline on flipX, you get it on the `getAt(v, pos())` call instead (which makes more sense since getAt takes an Int as second argument but pos returns hl.I64)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.