Closed
Description
Describe the bug
Unable to call a member function on a heap object.
To Reproduce
I am presuming the following should work seamlessly:
// test.cpp2
foo : type = {
print: (this) = std::cout << "Hello!\n";
}
main: () = {
f := new<foo>;
f*.print();
}
Transpiling works:
cppfront -version
cppfront compiler v0.2.1 Build 8910:1255
cppfront -p test.cpp2
test.cpp2... ok (all Cpp2, passes safety checks)
Compiling fails:
clang++-15 -std=c++20 test.cpp
test.cpp2:8:17: error: use of undeclared identifier 'print'
CPP2_UFCS_0(print, (*cpp2::assert_not_null(std::move(f))));