[Issue 7396] Indicate default alignment with 0.

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7396



--- Comment #25 from Iain Buclaw ibuc...@ubuntu.com 2012-06-29 09:22:59 PDT 
---
Thanks, I'll be merging this in tonight.  Does the frontend error if the
alignment given is not a power of 2?


ie: using align(3) should not ICE or compile.

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


[Issue 8316] New: Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316

   Summary: Regression with template functions
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: m...@paranoici.org


--- Comment #0 from meh. m...@paranoici.org 2012-06-29 09:53:16 PDT ---
The code:
---
import std.stdio;

void lol(string wat) ()
{
writeln(wat);
}

void lol(string wat) (string omg)
{
writeln(wat,  , omg);
}

void main ()
{
lol!rulez;
}
---

The error:
---
lol.d(15): Error: template lol.lol matches more than one template declaration,
lol.d(3):lol(string wat) and lol.d(8):lol(string wat)
---

I'm too lazy to find the commit, I'm sure you'll know better than me.

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


[Issue 8317] New: [ICE] (cast.c, line 1986) with array of lambdas

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8317

   Summary: [ICE] (cast.c, line 1986) with array of lambdas
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-06-29 10:01:00 PDT ---
void main() {
int function()[] foo = [() = 1, () = 'a']; // OK
int function()[] bar;
bar = [() = 1, () = 'a']; // ICE
}


DMD2.60alpha gives:

Assertion failure: 'd-purity != PUREfwdref' on line 1986 in file 'cast.c'

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


[Issue 8317] [ICE] (cast.c, line 1986) with array of lambdas

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8317


timon.g...@gmx.ch changed:

   What|Removed |Added

 CC||timon.g...@gmx.ch


--- Comment #1 from timon.g...@gmx.ch 2012-06-29 11:07:43 PDT ---
Probably related to or a duplicate of issue 8309. (the assertion there fails
for the same reason.)

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


[Issue 8315] Invalid nested-ref check in template constraint

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8315



--- Comment #2 from github-bugzi...@puremagic.com 2012-06-29 11:54:02 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/cdcf6451553f49509dabe9fa363996ae4e8e1e7b
fix Issue 8315 - Invalid nested-ref check in template constraint

https://github.com/D-Programming-Language/dmd/commit/ec5d4da9ac7c8ed6b0ef7c75765b0624aa67a994
Merge pull request #1029 from 9rnsr/fix8315

[Regression git] Issue 8315 - Invalid nested-ref check in template constraint

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


[Issue 8318] New: Cannot override a method with inferred return type

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8318

   Summary: Cannot override a method with inferred return type
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: d...@me.com


--- Comment #0 from Jacob Carlborg d...@me.com 2012-06-29 12:57:04 PDT ---
The following code fails to compile:

class Foo {
auto foo() {
return Foo.foo;
}
}

class Bar : Foo {
override auto foo() {
return Bar.foo;
}
}

void main() {}

It doesn't matter if override is specified or not. The error message received
is:

Error: function main.Bar.foo of type () overrides but is not covariant with
main.Foo.foo of type ()

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


[Issue 8315] Invalid nested-ref check in template constraint

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8315


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

   What|Removed |Added

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


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


[Issue 7396] Indicate default alignment with 0.

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7396



--- Comment #26 from Walter Bright bugzi...@digitalmars.com 2012-06-29 
15:18:16 PDT ---
Currently, it does not. I regard that as a separate issue, however.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316


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

   What|Removed |Added

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


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2012-06-29 
15:19:52 PDT ---
It does match both. Not sure what you expect it to do.

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


[Issue 8319] New: selective scoped import

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8319

   Summary: selective scoped import
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer ellery-newco...@utulsa.edu 2012-06-29 
15:21:41 PDT ---
..doesn't work

for example:

auto z(T)(T x) {
import std.traits: isPointer;
static assert(isPointer!T);

return 1;
}
void main() {
z(1);
z(a.ptr);
}


gives me:

test.d(3): Error: template instance isPointer!(int) template 'isPointer' is not
defined
test.d(8): Error: template instance test.z!(int) error instantiating
test.d(3): Error: template instance isPointer!(immutable(char)*) template
'isPointer' is not defined
test.d(9): Error: template instance test.z!(immutable(char)*) error
instantiating


whereas:

auto z(T)(T x) {
import std.traits;
static assert(isPointer!T);

return 1;
}
void main() {
z(1);
z(a.ptr);
}

sees isPointer and asserts as expected.

dmd 2.059.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316


timon.g...@gmx.ch changed:

   What|Removed |Added

 CC||timon.g...@gmx.ch


--- Comment #2 from timon.g...@gmx.ch 2012-06-29 16:25:29 PDT ---
Isn't it a function call where the parens were left out?

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


[Issue 8319] selective scoped import

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8319


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-06-29 16:30:27 PDT ---
This is a dupe, please search for it.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316


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

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #3 from Jonathan M Davis jmdavisp...@gmx.com 2012-06-29 16:45:53 
PDT ---
 Isn't it a function call where the parens were left out?

It would be if the functions didn't have any parameters, but they both do, so I
don't know quite what the compiler thinks that it is.

Regardless, lol!rulez results in a function named lol which takes a single
string argument when there's already such a function (albeit non-templated)
which exists. It's clearly a conflict no matter what you're trying to do with
it.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316



--- Comment #4 from timon.g...@gmx.ch 2012-06-29 16:47:38 PDT ---
(In reply to comment #3)
  Isn't it a function call where the parens were left out?
 
 It would be if the functions didn't have any parameters, but they both do, so 
 I
 don't know quite what the compiler thinks that it is.
 
 Regardless, lol!rulez results in a function named lol which takes a single
 string argument when there's already such a function (albeit non-templated)
 which exists. It's clearly a conflict no matter what you're trying to do with
 it.

I think you might have missed the second set of parentheses on the first
template function declaration.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316



--- Comment #5 from meh. m...@paranoici.org 2012-06-29 16:50:31 PDT ---
Both are template functions.

The first is a template function without arguments, the second has one.

I'm calling the first. It throws a dumb error when it's clear what I want to
do. It's code that worked before. It's a regression.

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


[Issue 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316



--- Comment #6 from Jonathan M Davis jmdavisp...@gmx.com 2012-06-29 17:01:10 
PDT ---
 I think you might have missed the second set of parentheses on the first
template function declaration.

Ah, you're right. I did miss those, but it still shouldn't compile, because the
compiler doesn't know which template the programmer was trying to instantiate.
Did they mean the first one (which would then be callable) or the second (which
wouldn't, because it lacks the function arguments that it requires). The
template functions don't even exist to be checked for overloading rules until
they've been instantiated, so overloading rules have no effect here. Remember
that they actually translate to

template lol(string wat)
{
void lol()
{
writeln(wat);
}
}

template lol(string wat)
{
void lol(string omg)
{
writeln(wat,  , omg);
}
}

So, when you say lol!rulez, which one is the compiler going to pick? It
doesn't know which you mean. The template signatures are identical and have no
template constraints to distinguish them. So, you have a conflict. If you did

template lol(string wat)
{
void lol()
{
writeln(wat);
}

void lol(string omg)
{
writeln(wat,  , omg);
}
}

then it would work (assuming that you didn't compile with -property, since then
you'd have to do lol!rulez() rather than lol!rulez, since the lol function
isn't a property). But with how they're currently declared, you have a conflict
between two templates.

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


[Issue 8319] selective scoped import

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8319



--- Comment #2 from Ellery Newcomer ellery-newco...@utulsa.edu 2012-06-29 
17:26:09 PDT ---
(In reply to comment #1)
 This is a dupe, please search for it.

before posting, I searched for scoped import and got nothing.

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


[Issue 8320] New: metastrings.Format and int array

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8320

   Summary: metastrings.Format and int array
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer ellery-newco...@utulsa.edu 2012-06-29 
18:22:46 PDT ---
Format does not properly format.

code:

import std.metastrings;
void main() {
static assert(false, Format!(abc %s, [1,2,3]));

}

produces:

test.d(3): Error: static assert  ['a','b','c',' ','\x01','\x02','\x03']

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


[Issue 8321] New: std.range.put doesnt work with RefCounted output range

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8321

   Summary: std.range.put doesnt work with RefCounted output
range
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2012-06-29 21:44:53 PDT ---
Test case:

import std.typecons, std.range;
struct S {
void put(int[] a){}
void put(int   n){}
}
void main() {
S s;
put(s,  1); // OK
put(s, [1]);// OK

auto rs = RefCounted!S();
put(rs,  1);// doesn't work
put(rs, [1]);   // doesn't work
}


To fix this issue, both Phobos and dmd needs to be fixed.
- std.traits.hasMembers doesn't see the members through alias this.
- There is no way to check whether a type T has a member xxx or not, while
avoiding UFCS.

I've conceived following technique, but doesn't work with current dmd.

struct T { void put(){} }
alias T.put X;   // Type.member doesn't test UFCS,
 // but getting symbol of xxx would work!
struct S { T t; alias t this; }
alias S.put X;   // Getting symbol through alias this doesn't work...

I think we need to fix bug 4617.

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


[Issue 8319] selective scoped import

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8319


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-06-29 21:48:47 PDT ---
This is a dup of issue 7494, and it's already fixed in 2.060head.

*** This issue has been marked as a duplicate of issue 7494 ***

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


[Issue 7494] Selective import does not work inside a function

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7494


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

   What|Removed |Added

 CC||ellery-newco...@utulsa.edu


--- Comment #10 from Kenji Hara k.hara...@gmail.com 2012-06-29 21:48:47 PDT 
---
*** Issue 8319 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 8316] Regression with template functions

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8316


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

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #7 from Kenji Hara k.hara...@gmail.com 2012-06-29 22:14:10 PDT ---
(In reply to comment #6)
  I think you might have missed the second set of parentheses on the first
 template function declaration.
 
 Ah, you're right. I did miss those, but it still shouldn't compile, because 
 the
 compiler doesn't know which template the programmer was trying to instantiate.
 Did they mean the first one (which would then be callable) or the second 
 (which
 wouldn't, because it lacks the function arguments that it requires). The
 template functions don't even exist to be checked for overloading rules until
 they've been instantiated, so overloading rules have no effect here. Remember
 that they actually translate to
 
[snip]
 
 So, when you say lol!rulez, which one is the compiler going to pick? It
 doesn't know which you mean. The template signatures are identical and have no
 template constraints to distinguish them. So, you have a conflict.

I think it should be compile.
In D language, template functions, that is a template contains one function
declaration, is specially treated in its call, and it is priority than normal
template lookup/instantiation rule.
In this case, compiler knows the the two lol's are template functions, so such
special rule should be applied.

In current dmd without -property switch, lol!rulez should be implicitly
converted to lol!rulez(), and matches to the first declaration of lol.

Furthermore says, even if you add @property and use -property, following code
doesn't work.

@property void lol(string wat) ()
{
writeln(wat);
}
@property void lol(string wat) (string omg)
{
writeln(wat,  , omg);
}
void main()
{
lol!rulez;// should call the first
lol!rulez = xxx;// should call the second
}

test.d(13): Error: template test.lol matches more than one template
declaration, test.d(3):lol(string wat) and test.d(7):lol(string
wat)
test.d(14): Error: template test.lol matches more than one template
declaration, test.d(3):lol(string wat) and test.d(7):lol(string
wat)

It seems to me that is definitely correct code, but if we make this issue
invalid, such property overloading would also become 'invalid'. I cannot accept
it.

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


[Issue 8322] New: std.string.chomp does not handle combining characters correctly

2012-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8322

   Summary: std.string.chomp does not handle combining characters
correctly
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis jmdavisp...@gmx.com 2012-06-29 22:47:40 
PDT ---
These two succeed:

assert(equal(chomp(hello \u00E9, \u00E9), hello ));
assert(equal(chomp(hello e\u0301, e\u0301), hello ));

These two fail:

assert(equal(chomp(hello \u00E9, e\u0301), hello ));
assert(equal(chomp(hello e\u0301, \u00E9), hello ));

It's because chomp makes the erroneous assumption that if a string ends with
the delimiter, the code points match exactly.

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