We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug cppfront errors when attempting to do this.
To Reproduce
f: (a: *() -> int) = {}
callback.cpp2(3,9): error: '*'/'const' type qualifiers must be followed by a type name or '_' wildcard (at '(')
Using a type alias also fails:
F: type == () -> int; f: (a: *F) = {}
callback.cpp2(1,13): error: a 'type ==' alias declaration must be followed by a type name
The text was updated successfully, but these errors were encountered:
This is #711 and #343.
Sorry, something went wrong.
Those use std::function, a template type, whereas this is about parsing a pointer to function type. Though it looks like #526 would fix this too.
std::function
They're all about being able to name function types. To name a pointer to function type, you need to name a function type.
Thanks! Your code is now working with PR #1183:
F: type == () -> int; f1: (a: *F) = std::cout << a(); f2: (a: *() -> int) = std::cout << a(); g: () -> int = 42; main: () = { f1(g&); f2(g&); }
Successfully merging a pull request may close this issue.
Describe the bug
cppfront errors when attempting to do this.
To Reproduce
Using a type alias also fails:
The text was updated successfully, but these errors were encountered: