Thread overview
[Issue 3279] New: Type tuple comparison fails
Oct 29, 2009
Don
Oct 11, 2010
Manuel König
[Issue 3279] Confusing error message when comparing types
Feb 15, 2012
yebblies
September 01, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3279

           Summary: Type tuple comparison fails
           Product: D
           Version: 2.032
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bartosz@relisoft.com


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));
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3279


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |clugdbug@yahoo.com.au
           Severity|blocker                     |major


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2009-10-29 08:53:55 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 11, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3279



--- Comment #2 from Manuel König <manuelk89@gmx.net> 2010-10-11 10:24:49 PDT ---
*** Issue 3278 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3279


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.032                       |D1 & D2
           Keywords|                            |pull
           Platform|x86                         |All
                 CC|                            |yebblies@gmail.com
         AssignedTo|nobody@puremagic.com        |yebblies@gmail.com
             Blocks|4239                        |
            Summary|Type tuple comparison fails |Confusing error message
                   |                            |when comparing types
           Severity|major                       |minor
         OS/Version|Windows                     |All


--- Comment #3 from yebblies <yebblies@gmail.com> 2012-02-15 15:43:53 EST ---
https://github.com/D-Programming-Language/dmd/pull/720

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3279



--- Comment #4 from github-bugzilla@puremagic.com 2012-02-17 16:27:00 PST ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------