Skip to content

Methods being called on native objects as Objective-C functions, not the haxe versions #6

Description

@zeen
@:keep private function test(s :Array<String>) {
    var i = s.length;
    var j = s.join(" ");
    var k = "hello";
    var l = k.length;
}

compiles to

- (void) test:(NSMutableArray*)s{

    int i = s.length;

    NSString *j = [s join:@" "];

    NSString *k = @"hello";
    int l = k.length;
}

This crashes, because length property and the join: selector don't exist in NSMutableArray, and length doesn't exist on NSString either, they should have been replaced with the Haxe code in Array.hx and String.hx.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions