extern void foo(); // passes if 'extern' is removed
void foo();
void foo() {}
void main()
{
foo();
}
onlineapp.d(13): Error: `a.foo` called with argument types `()` matches both:
onlineapp.d(6): `a.foo()`
and:
onlineapp.d(9): `a.foo()`
Applying 'extern' to a function should either be an error or have no effect.
Comment #1 by razvan.nitu1305 — 2023-02-24T12:43:41Z
What does extern do for functions? Can't we just deprecate it?
Comment #2 by razvan.nitu1305 — 2023-02-24T12:45:01Z
I mean, https://dlang.org/spec/declaration.html#extern doesn't offer any function examples and it states: "The primary usefulness of Extern Declarations is to connect with global variables declarations and functions in C or C++ files.". But I don't see how extern (not extern(linkage)) is used to do that.
Comment #3 by robert.schadek — 2024-12-13T19:27:23Z