Bug 3279 – (D1 only) Confusing error message when comparing types

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2009-09-01T16:01:00Z
Last change time
2013-11-16T23:10:07Z
Keywords
diagnostic, pull
Assigned to
yebblies
Creator
bartosz

Comments

Comment #0 by bartosz — 2009-09-01T16:01:39Z
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)); ----
Comment #1 by clugdbug — 2009-10-29T08:53:55Z
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.
Comment #2 by manuelk89 — 2010-10-11T10:24:49Z
*** Issue 3278 has been marked as a duplicate of this issue. ***
Comment #3 by yebblies — 2012-02-14T20:43:53Z
Comment #4 by github-bugzilla — 2012-02-17T16:27:00Z
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
Comment #5 by yebblies — 2013-11-16T23:10:07Z
Closing because D1 is no longer supported.