HaxeFoundation / HaxeFoundation/hxcpp

Some issues with nativeGen

Open
#754 12 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

```haxe
@:nativeGen
interface SampleInterface
{
function foo() : Void;
}

class SampleApp implements SampleInterface
{
private static var gSampleApp:SampleApp;

static var gSampleInterface : SampleInterface = null;
private var vSampleInterface : Array;
private var mMapSampleInterface : Map;
private var mSampleInterface : SampleInterface;

public static function main()
{
gSampleApp = new SampleApp();
}

public function foo()
{
trace("called!");
}

private function sampleFunction(onCallback : Void -> Void) : Void
{
onCallback();
}

public function new()
{
vSampleInterface = new Array();
vSampleInterface.push(this);

mMapSampleInterface = new Map();
mMapSampleInterface.set(1,this);
trace(mMapSampleInterface);
for (si in mMapSampleInterface)
{
trace(si);
}

var sampleInterface = mMapSampleInterface.get(0);
trace(sampleInterface);
var sampleInterface = mMapSampleInterface.get(1);
trace(sampleInterface);

mSampleInterface = this;
// This does not compile
//sampleFunction( mSampleInterface.foo );
sampleFunction( function() mSampleInterface.foo());
}
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.