seanbaxter / circle

The compiler is available for download. Get it!
http://www.circle-lang.org/
2.35k stars 72 forks source link

Circle doesn't accept function reference type in auto-arrow notation #123

Open correaa opened 2 years ago

correaa commented 2 years ago

Hi Sean,

How are you?

In case you are interested, there is a bug in circle that doesn't allow to use the auto -> notation to express function reference (and function pointer) types:

https://godbolt.org/z/cTKzGx46n

auto f(double d) -> int;
auto f(char   c)  -> int;

auto f(double /*d*/) -> int {return 5;}
auto f(char   /*c*/) -> int {return 6;}

int main() {
    auto fr1 = static_cast<int (&)(double)>(f);  // ok
    auto fr2 = static_cast<auto (&)(double) -> int>(f);  // doesn't compile, should be equivalent
}