HaxeFoundation / HaxeFoundation/haxe

[flash] Illegal override when overriding extern properties in a specific case

Open
#9,914 0 comments 0 reactions 0 assignees View on GitHub
bug haxe-foundation-partner platform-flash
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
interface I {
@:flash.property var name(never,set):String;
}

class A extends flash.display.Sprite implements I {}

class B extends A {
override function set_name(value:String):String {
return super.set_name(value);
}
}
```

This compiles fine, but at run-time it immediately throws `VerifyError: Error #1053: Illegal override of set_name in B.`

Looks like there's a flaw somewhere in my `@:flash.property` logic, but I don't have a lot of time to look into it right now, so if someone can figure this out before me, I'd appreciate it very much! ^_^

I'm adding the partner label because the issue comes from one of our codebases and we don't know yet how complicated would it be to work it around.

Contributor guide

Open the contributing guide

Research direction

Reproduce the VerifyError with the provided Haxe classes and inspect the compiler's @:flash.property handling for extern properties and generated set_name overrides. Compare the generated Flash output for A and B; done means the example runs without the illegal-override error and the case has regression coverage.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.