I get this strange error message: Error: incompatible types for (((long, int)) == ((long, int))): '(long, int)' and '(long, int)' when compiling this program: ---- import std.typetuple; template TypeList(T...) { alias T toTuple; } template snoC(T, alias List) { alias TypeList!(List.toTuple, T) snoC; } static assert (snoC!(int, TypeList!(long)).toTuple == TypeTuple!(long, int)); ----
This is a diagnostic bug. The error message is highly misleading. Even this won't compile: static assert (TypeTuple!(long, int) == TypeTuple!(long, int)); And it *shouldn't* compile, since they are types, not expressions, so they can't be compared with ==. The code should be rewritten as: static assert (is(snoC!(int, TypeList!(long)).toTuple == TypeTuple!(long, int))); which compiles. Downgrading from blocker to major. While investigating this I found bug 3451.
*** Issue 3278 has been marked as a duplicate of this issue. ***
https://github.com/D-Programming-Language/dmd/pull/720
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d76645b7ec4f33b7ae60bd63cfc9bd54ca45b2b9 Merge pull request #720 from yebblies/issue3279 Issue 3279 - Confusing error message when comparing types
Closing because D1 is no longer supported.