https://issues.dlang.org/show_bug.cgi?id=22842
Issue ID: 22842
Summary: importC: Error: variable 'fun' cannot be declared to
be a function
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Declaring functions has two equivalent syntaxes.
---
int fun();
---
typedef int (tfunc)();
tfunc fun;
---
The latter is however rejected by the compiler.
Related code results in "Error: function 'fun' conflicts with variable 'fun'"
---
typedef int (myfunc)();
static myfunc fun;
int main()
{
return fun();
}
int fun() // inherits "static" from declaration.
{
return 0;
}
--