www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6902] New: Different "pure nothrow int()" types

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902

           Summary: Different "pure nothrow int()" types
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



---
---
void main() {
    static assert(is(typeof({
        return int.init; // int, long, real, etc.
    })));

    int f() pure nothrow { assert(0); }
    alias int T() pure nothrow;
    static if(is(typeof(&f) DT == delegate)) {
        static assert(is(DT* == T*));  // ok

        // Error: static assert  (is(pure nothrow int() == pure nothrow int()))
is false
        static assert(is(DT == T));
    }
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



I thought we got rid of those crazy function types. Seems that they've survived
in alias declarations somehow.

The declaration of T shouldn't compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902




Good reducing!
I found a function/delegate literal type inference bug.

I have done Phobos unit tests with my patch, and this resolves Phobos build
breaking in Windows.
http://d.puremagic.com/test-results/test_data.ghtml?dataid=113170

Please wait the patch a while.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid



https://github.com/D-Programming-Language/dmd/pull/498
https://github.com/D-Programming-Language/phobos/pull/322

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



https://github.com/D-Programming-Language/dmd/commit/3af76245c7626a1489322bb6fc8353b1c4aa2e35

https://github.com/D-Programming-Language/phobos/commit/b7a9f446dfb9e299354318437d1e6a5752d5feca

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 14 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code dawg.eu



*** Issue 6600 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: -------
Jan 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902




cat > bug.d << CODE
void a()
{
    function void() { }();
}

void b()
{
    static void safe_nothrow()  safe nothrow pure { }
    auto f = &safe_nothrow;
    enum mangle = typeof(*f).mangleof;
    static assert(mangle == "FNaNbNfZv", mangle);
}
CODE

dmd -c bug

----

I've actually found a new failing test case for this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902




*** Issue 3796 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: -------
Jan 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 16 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




 cat > bug.d << CODE
 void a()
 {
     function void() { }();
 }
 
 void b()
 {
     static void safe_nothrow()  safe nothrow pure { }
     auto f = &safe_nothrow;
     enum mangle = typeof(*f).mangleof;
     static assert(mangle == "FNaNbNfZv", mangle);
 }
 CODE
 
 dmd -c bug
 
 ----
 
 I've actually found a new failing test case for this.
-- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 21 2013