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

fix cast error if Std.string fails #11607

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ncannasse
Copy link
Member

This fixes an error when a toString() raises an error, this can be reproduced with the following sample:

class Foo {
   var o : Map<String, Foo> = [];
   public function new() {
      o.set("x", this);
   }
   public function toString() {
		return "Foo:"+o; // will stack overflow
   }
}
class Main {
    static function main() {
        cast(new Foo(), Main); // should raise cast error
    }
}

Should be tested and fixed on other platforms as well.

@skial skial mentioned this pull request Mar 18, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants