HaxeFoundation / HaxeFoundation/haxe

[cpp] Broken code generated from objc externs

Open
#11,125 0 comments 0 reactions 0 assignees View on GitHub
test-disabled
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

To keep track of [a few objective c extern tests](https://github.com/HaxeFoundation/haxe/pull/11123/commits/7c10adf7c313512e85eeb8b99c3f8162d8b47537) that were disabled in #11123.

In 76cac7b500165cb875d1206e69088f5c6eb972ed, member access for extern classes was changed from `->` to `.`. This is fine for properties with getters, but for regular member variables without getters, this causes objective c compiler errors:
```
Error: ./src/TestObjc.mm:89:53: error: no getter method for read from property
HXLINE( 26) ::utest::Assert_obj::equals(this->cls.otherThing,42,null(),::hx::SourceInfo(HX_("TestObjc.hx",60,3f,d0,21),26,HX_("TestObjc",1e,aa,8d,26),HX_("testCall",10,9e,ec,44)));
~~~~~~~~~~^~~~~~~~~~
./src/TestObjc.mm:134:53: error: no getter method for read from property
HXLINE( 47) ::utest::Assert_obj::equals(this->cls.otherThing,142,null(),::hx::SourceInfo(HX_("TestObjc.hx",60,3f,d0,21),47,HX_("TestObjc",1e,aa,8d,26),HX_("testVar",b5,4d,c8,bd)));
~~~~~~~~~~^~~~~~~~~~
2 errors generated.
```

Contributor guide

Open the contributing guide

Research direction

Start with the disabled Objective-C extern tests referenced in pull request #11123 and the member-access change in commit 76cac7b500165cb875d1206e69088f5c6eb972ed. Inspect the generated src/TestObjc.mm errors and related TestObjc.hx cases; done means regular extern member variables compile and the Objective-C tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, objective-c
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.