[cppia] extern static property getter

Open
#1,183 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Reproduce the failure from the cpp host and cppia script examples, using Test.hx and the cpp.cppia.Host.runFile entry point. Trace how the extern static property getter is resolved and verify that running bin/script.cppia no longer reports Unknown function or Unknown global for Test_obj::get_foo.

Written by the indexing model from the issue text.

Description

cpp host code:

class Host {
	public static function main() {
		trace(Test.foo); // bring the class into compilation
		cpp.cppia.Host.runFile('bin/script.cppia');
	}
}

cppia script code:

class Script {
	static function main() {
		trace("Hello from script!");
		trace(Test.foo);
	}
}

and Test.hx file for both

#if cppia
extern class Test {
	static var foo(get, never):Int;
}
#else
class Test {
	public static var foo(get, never):Int;
	static function get_foo():Int return 42;
}
#end

will result in error:

Unknown function : Test_obj::get_foo(0)
Error : Unknown global:Test_obj::get_foo
Dominant language
C++
Stars
330
Forks
237
Avg merge
1d 3h
Merged PRs (30d)
20

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/hxcpp

All issues in HaxeFoundation/hxcpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.