HaxeFoundation / HaxeFoundation/haxe

error C2227: left of '->reinterpret' must point to class/struct/union/generic type

Open
#9,495 4 comments 0 reactions 1 assignee Claimed by @hughsando View on GitHub
bug platform-cpp regression
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

I'm getting the following error in Haxe 4.1.0 and 4.1.1 that worked in 4.0.5:
`error C2227: left of '->reinterpret' must point to class/struct/union/generic type`
When trying the following sample:
```
class Main
{
static function main() {
#if cpp
var testString:String = "Hi there";
var rawPointerReturnVal:cpp.RawConstPointer = cpp.StdString.ofString(testString).c_str().reinterpret().constRaw;
#end
}
}
```
Resulting relevant cpp:
```
void Main_obj::main(){
HX_STACKFRAME(&_hx_pos_e47a9afac0942eb9_9_main)
HXLINE( 11) ::String testString = HX_("Hi there",25,dc,6f,ff);
HXLINE( 12) const void* rawPointerReturnVal = ::hx::StdString(testString).c_str()->reinterpret()->get_constRaw();
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.