On Tuesday, 14 November 2017 at 13:20:22 UTC, Nick Treleaven wrote:

An very similar problem exists for int and char overloads:

alias foo = (char c) => 1;
alias foo = (int i) => 4;

enum int e = 7;
static assert(foo(e) == 4); // fails

Wait a minute! This doesn't appear to be a casting or overload problem. Can you really overload aliases in D?

I would expect the compiler to throw an error as `foo` is being redefined. Or for `foo` to be replaced by the most recent assignment in lexical order. Am I missing something?

Mike

Reply via email to