[Issue 3467] Non-int integral template parameters not correctly propagated

2019-10-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3467

RazvanN  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #16 from RazvanN  ---
D1 is no longer supported. Closing...

--


[Issue 3467] Non-int integral template parameters not correctly propagated

2014-05-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3467

k...@redstar.de changed:

   What|Removed |Added

 CC||k...@redstar.de

--- Comment #14 from k...@redstar.de ---
As a side effect, the name mangling is wrong.

Lets change the type parameter from uint to ulong. Then the bar function of

foo!( 4 ) baz

is mangled as

_D7bug346712__T3fooVii4Z3foo3barMFNaNbNiNfZS7bug346712__T3fooVii4Z3foo

but bar function of

foo!( 4L ) baz

is mangled as

_D7bug346712__T3fooVli4Z3foo3barMFNaNbNiNfZS7bug346712__T3fooVli4Z3foo

In both cases, I would expect

_D7bug346712__T3fooVmi4Z3foo3barMFNaNbNiNfZS7bug346712__T3fooVmi4Z3foo

because the type parameter is ulong.

--


[Issue 3467] Non-int integral template parameters not correctly propagated

2014-05-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3467

--- Comment #15 from David Nadlinger c...@klickverbot.at ---
@Kai: Note that this report is marked as D1 only now. You might want to open a
new issue for the mangling problem.

--


[Issue 3467] Non-int integral template parameters not correctly propagated

2014-03-01 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=3467



--- Comment #13 from github-bugzi...@puremagic.com 2014-03-01 12:24:43 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/2a56f5cc3dea215946f6e0ae8ac2c8c9be32686b
fix Issue 3467 - Non-int integral template parameters not correctly propagated

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2012-10-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Denis Shelomovskij verylonglogin@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
Version|D1  D2 |D1
 Resolution|FIXED   |


--- Comment #12 from Denis Shelomovskij verylonglogin@gmail.com 
2012-10-30 16:49:11 MSK ---
(In reply to comment #10)
 https://github.com/D-Programming-Language/dmd/commit/f8ad107800a2c9bf116779a49abe9945daf9d05f
 
 Resolved for D2 only.

So it's D1 issue now.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2012-04-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||pun...@coverify.org


--- Comment #11 from Kenji Hara k.hara...@gmail.com 2012-04-24 18:01:52 PDT 
---
*** Issue 6246 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: ---


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-12-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 CC||c...@klickverbot.at


--- Comment #9 from klickverbot c...@klickverbot.at 2011-12-10 05:23:02 PST 
---
(In reply to comment #6)
 There are two solutions:
 1. Makes that instantiation invalid.
 2. Promote signed integer template value parameter into unsigned.
 
 My patch implements #2, and I believe that is correct.
 Because non-suffix integer literal can implicitly convertible to unsigned.
 
 And, my patch doesn't break existing code around template overloading.

I agree. For an integer _value_ (and this is what we are talking about here),
distinguishing between 3 and 3u just makes no sense.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-12-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

   Severity|normal  |enhancement


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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-12-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2011-12-10 
16:38:45 PST ---
https://github.com/D-Programming-Language/dmd/commit/f8ad107800a2c9bf116779a49abe9945daf9d05f

Resolved for D2 only.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-12-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467



--- Comment #8 from Kenji Hara k.hara...@gmail.com 2011-12-01 13:51:15 PST ---
Updated pull/449 to fix bug2550, they are almost same issues.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||komad...@gekkou.co.uk


--- Comment #7 from Kenji Hara k.hara...@gmail.com 2011-11-28 16:59:59 PST ---
*** Issue 3210 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: ---


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-11-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #6 from Kenji Hara k.hara...@gmail.com 2011-11-23 16:27:10 PST ---
(In reply to comment #4)
 I believe this is not a bug. The type of a template is based on what its
 argument types are, not its parameter types. Hence,
 
   foo!3
 
 is always a different type from:
 
   foo!3u
 
 even if foo is defined to take an int parameter.

The issue is that the foo template with signed integer makes incorrect
instantiation internally.

There are two solutions:
1. Makes that instantiation invalid.
2. Promote signed integer template value parameter into unsigned.

My patch implements #2, and I believe that is correct.
Because non-suffix integer literal can implicitly convertible to unsigned.

And, my patch doesn't break existing code around template overloading.
Following code still valid.

template Foo(int n){ enum Foo = 1; }
template Foo(uint n){ enum Foo = 2; }
static assert(Foo!10 == 1);
static assert(Foo!10u == 2);

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-11-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||INVALID


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2011-11-19 
23:26:17 PST ---
I believe this is not a bug. The type of a template is based on what its
argument types are, not its parameter types. Hence,

  foo!3

is always a different type from:

  foo!3u

even if foo is defined to take an int parameter.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-11-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Jonathan M Davis jmdavisp...@gmx.com changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #5 from Jonathan M Davis jmdavisp...@gmx.com 2011-11-19 23:39:12 
PST ---
Why? I understand instantiating a different template with different arguments
when the type itself is the argument. But when you've typed the argument, it's
essentially the same as passing an argument to a function, only it's a template
argument instead of a function argument.

In this case, the template says that it takes a uint. I would expect that it
then would instatiated based on the _value_ of the argument, not its _type_. It
already _has_ a type - uint. Making foo!3 and foo!3u be different is just plain
confusing because they're being given the exact same value.

What value is there in having foo!3 and foo!3u be different? What does it add?
I don't understand how the _type_ of the argument could matter when the type is
already defined by the template and it's the value that changes between
instantiations.

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||verylonglogin@gmail.com


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-10-14 01:49:12 PDT ---
*** Issue 6806 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: ---


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||patch
   Platform|Other   |All
Version|2.035   |D1  D2
 OS/Version|Windows |All


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-10-14 01:51:11 PDT ---
From bug 6806, this is D1  D2 issue.

And D2 patch:
https://github.com/D-Programming-Language/dmd/pull/449

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2010-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-09-25 16:29:51 PDT ---
The bug is present in dmd 2.049 still:


struct Vec(size_t N) {
void opBinary(string op:~, size_t M)(Vec!M) {}
}
void main() {
Vec!2 a1;
Vec!3 a2;
a1 ~ a2; // line 7, Error
}

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