D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3279 - (D1 only) Confusing error message when comparing types
Summary: (D1 only) Confusing error message when comparing types
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 minor
Assignee: yebblies
URL:
Keywords: diagnostic, pull
: 3278 (view as issue list)
Depends on:
Blocks:
 
Reported: 2009-09-01 16:01 UTC by Bartosz Milewski
Modified: 2013-11-16 23:10 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bartosz Milewski 2009-09-01 16:01:39 UTC
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 Don 2009-10-29 08:53:55 UTC
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 Manuel König 2010-10-11 10:24:49 UTC
*** Issue 3278 has been marked as a duplicate of this issue. ***
Comment 4 github-bugzilla 2012-02-17 16:27:00 UTC
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 yebblies 2013-11-16 23:10:07 UTC
Closing because D1 is no longer supported.