View mode: basic / threaded / horizontal-split · Log in · Help
November 07, 2011
[Issue 6902] New: Different "pure nothrow int()" types
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


--- Comment #0 from Denis <verylonglogin.reg@gmail.com> 2011-11-07 12:43:54 MSK ---
---
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: -------
November 07, 2011
[Issue 6902] Different "pure nothrow int()" types
http://d.puremagic.com/issues/show_bug.cgi?id=6902


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

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


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-11-07 03:21:28 PST ---
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: -------
November 07, 2011
[Issue 6902] Different "pure nothrow int()" types
http://d.puremagic.com/issues/show_bug.cgi?id=6902



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-07 03:33:51 PST ---
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: -------
November 07, 2011
[Issue 6902] Different "pure nothrow int()" types
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


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-07 04:35:15 PST ---
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: -------
November 14, 2011
[Issue 6902] Different "pure nothrow int()" types
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


--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-14 04:46:51 PST ---
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: -------
January 17, 2013
[Issue 6902] Different "pure nothrow int()" types
http://d.puremagic.com/issues/show_bug.cgi?id=6902


Martin Nowak <code@dawg.eu> changed:

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


--- Comment #5 from Martin Nowak <code@dawg.eu> 2013-01-16 21:26:47 PST ---
*** 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: -------
January 17, 2013
[Issue 6902] Different "pure nothrow int()" types
http://d.puremagic.com/issues/show_bug.cgi?id=6902



--- Comment #6 from Martin Nowak <code@dawg.eu> 2013-01-16 21:28:49 PST ---
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: -------
January 17, 2013
[Issue 6902] Different "pure nothrow int()" types
http://d.puremagic.com/issues/show_bug.cgi?id=6902



--- Comment #7 from Martin Nowak <code@dawg.eu> 2013-01-16 21:39:05 PST ---
*** 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: -------
January 17, 2013
[Issue 6902] Different "pure nothrow int()" types
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: -------
January 22, 2013
[Issue 6902] Different "pure nothrow int()" types
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


--- Comment #8 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-21 23:02:46 PST ---
(In reply to comment #6)
> 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.

It is a dup of bug 8504. Pull #1096 will fix the issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home