Skip to content
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

HxOverrides undefined or missing members unless --dce set to no #11427

Closed
Tracked by #11583
thomasjwebb opened this issue Dec 12, 2023 · 1 comment
Closed
Tracked by #11583

HxOverrides undefined or missing members unless --dce set to no #11427

thomasjwebb opened this issue Dec 12, 2023 · 1 comment
Labels
platform-python Everything related to Python

Comments

@thomasjwebb
Copy link

When doing operations involving modulo (because python has a non-standard implementation, I'm guessing) the haxe-generated Python code uses HxOverrides.mod to replace python's %. In one of my projects, I had to add --dce no to prevent this from happening when running the output using the python interpreter:

AttributeError: type object 'HxOverrides' has no attribute 'mod'

I tried to make a more minimal example to illustrate the problem and it instead will not even define HxOverrides unless I use --dce no.

Minimal example

Main.hx

package;

class Main
{
    public static function main() {
        var a:Int = -5;
        a = a % 7;
        trace(a);
    }
}

This is with the latest haxe (4.3.3) so it should have fixes for similar issues I've seen in closed issues.

@kLabz kLabz added the platform-python Everything related to Python label Dec 12, 2023
@kLabz kLabz added this to the 4.3 Hotfix candidates milestone Dec 12, 2023
@Simn Simn closed this as completed in 787c3a4 Dec 13, 2023
@Simn
Copy link
Member

Simn commented Dec 13, 2023

The problem here was that the analyzer changed this to a %= 7 and DCE didn't check that particular pattern.

0b1kn00b pushed a commit to 0b1kn00b/haxe that referenced this issue Jan 25, 2024
@kLabz kLabz mentioned this issue Feb 18, 2024
19 tasks
kLabz pushed a commit that referenced this issue Feb 18, 2024
@kLabz kLabz removed this from the 4.3 Hotfix candidates milestone Feb 18, 2024
kLabz pushed a commit that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-python Everything related to Python
3 participants