[Issue 6681] struct constructor call is converted to struct literal that breaks union initialization

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6681


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||rejects-valid
 AssignedTo|nob...@puremagic.com|yebbl...@gmail.com


--- Comment #9 from yebblies yebbl...@gmail.com 2012-02-17 21:07:11 EST ---
I think for this to work, the interpreter needs to be able to handle
uninitialized values, and unions need to default to void initializers.  I have
a patch for this that is nearly ready, and solves issue 6438 at the same time.

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


[Issue 7263] Tuple indexing/slicing + -O switch causes used before set error

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7263


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||FIXED


--- Comment #3 from yebblies yebbl...@gmail.com 2012-02-17 22:42:39 EST ---
Works for me, presumably fixed by the fix to issue 4940

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

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


[Issue 7262] 'used before set' error with no line number

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7262


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||FIXED


--- Comment #2 from yebblies yebbl...@gmail.com 2012-02-17 22:41:15 EST ---
Works for me, presumably fixed by the fix to issue 4940

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

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


[Issue 7530] New: Postblit not called structs returned from an array index expr.

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7530

   Summary: Postblit not called structs returned from an array
index expr.
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: wrong-code
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: slud...@outerproduct.org


--- Comment #0 from S�nke Ludwig slud...@outerproduct.org 2012-02-17 04:15:29 
PST ---
Created an attachment (id=1076)
Reproduction case

Attached is a small example with a pseudo RefCount struct.
Running with the ternary operator enabled dmd -version=BUG -run yields:

---
1st pass
CREATE 18FE34 1
COPY 443FD0 2
DESTROY 18FE34 2 IN
DESTROY 18FE34 1 OUT
POS2: 443FD0 1
DESTROY 18FE5C 1 IN  - destroys the object although the static
DESTROY 18FE5C -100 OUT array should still hold a reference

2nd pass
POS1: 443FD0 0   - the static variable now references an
POS2: 443FD0 0  already destroyed object
DESTROY 18FE5C 0 IN
DESTROY 18FE5C -1 OUT
---

The line return cnt[0]; fails to call the struct's postblit and
causes the returned object to get destroyed as the ref count goes to
zero.

running with dmd -run yields the expected output:

---
1st pass
CREATE 18FE34 1
COPY 4B3FD0 2
DESTROY 18FE34 2 IN
DESTROY 18FE34 1 OUT
POS2: 4B3FD0 1
COPY 18FE5C 2 - correctly copied on return
DESTROY 18FE5C 2 IN
DESTROY 18FE5C 1 OUT

2nd pass
POS1: 4B3FD0 1
POS2: 4B3FD0 1
COPY 18FE5C 2 - correctly copied on return
DESTROY 18FE5C 2 IN
DESTROY 18FE5C 1 OUT  - the static reference is still there
---

auto ret = cnt[0]; return ret; will correctly call the postblit constructor.

Occurs at least in DMD 2.058 and 2.057.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #7 from d...@dawgfoto.de 2012-02-17 06:52:19 PST ---
void foo(T)(Unsigned!T val)
{
}

foo(2u);

???

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #8 from timon.g...@gmx.ch 2012-02-17 06:54:08 PST ---
Unsigned is not an alias template. Your example is unrelated to this
enhancement.

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


[Issue 7531] New: writeln doesn't work an a range that uses some char as front

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7531

   Summary: writeln doesn't work an a range that uses some char as
front
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: simend...@gmail.com


--- Comment #0 from simendsjo simend...@gmail.com 2012-02-17 07:04:04 PST ---
import std.stdio;
struct S {
void popFront() { }

char front() {
return 'a';
}

@property bool empty() {
return false;
}
}
void main() {
writeln(S());
}


range.d(295): Error: static assert  Cannot put a S into a LockingTextWriter
format.d(1509):instantiated from here: put!(LockingTextWriter,S)
format.d(1984):instantiated from here:
formatRange!(LockingTextWriter,S,char)
format.d(2228):instantiated from here:
formatValue!(LockingTextWriter,S,char)
format.d(319):instantiated from here:
formatGeneric!(LockingTextWriter,S,char)
stdio.d(684):instantiated from here:
formattedWrite!(LockingTextWriter,char,S)
stdio.d(1563):instantiated from here: write!(S,char)

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


[Issue 7531] writeln doesn't work an a range that uses some char as front

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7531



--- Comment #1 from simendsjo simend...@gmail.com 2012-02-17 07:05:52 PST ---
Using 2.058

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


[Issue 7531] writeln doesn't work an a range that uses some char as front

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7531


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #2 from Kenji Hara k.hara...@gmail.com 2012-02-17 07:13:24 PST ---
This is a dup of bug 7476. Read comment#7 in it.

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

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


[Issue 7476] Write(ln) functions no longer accept retro range

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7476


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

   What|Removed |Added

 CC||simend...@gmail.com


--- Comment #9 from Kenji Hara k.hara...@gmail.com 2012-02-17 07:13:24 PST ---
*** Issue 7531 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 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #9 from Kenji Hara k.hara...@gmail.com 2012-02-17 07:10:54 PST ---
I think this is invalid issue.
Reduced case:

void f(T)(T, T) { pragma(msg, T); }
void main()
{
  f(0L, 0);   // first argument is long, and second one is int
  // Error: template test.f(T) does not match any function template declaration
}

In IFTI, arguments don't have any dependencies each other about the deduction.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #10 from timon.g...@gmx.ch 2012-02-17 07:20:59 PST ---
If you think it is invalid you misunderstand the issue. This is about extending
IFTI so that it can match templated aliases.

template Alias(T){ alias Foo!T Alias;}

void foo(T)(Alias!T x){ pragma(msg, T); }

foo(Foo!int); // prints 'int'

What effectively would need to be done at the compiler side:

- If a template parameter type is a template, check whether it is an eponymous
alias template (like template Alias(T){ alias Foo!T Alias; }
- If so, expand the template without knowing the type it is instantiated with

void foo(T)(Alias!T x){ ... } = void foo(T)(Foo!T x){ ... }

This is always a valid transformation for eponymous alias templates.

This does not introduce any dependencies across parameters.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #11 from d...@dawgfoto.de 2012-02-17 07:25:35 PST ---
Is that what you mean by alias template.
template Wrap(T) { alias T Wrap; } // no members, no static if

This has a bidirectional mapping, but you can't change the type any longer.
'void foo(T)(Wrap!T val)' would always be equal to 'void foo(T)(T val)'

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


[Issue 7511] attribute inference does not work for methods of templated aggregates

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7511


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

   What|Removed |Added

   Severity|normal  |enhancement


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-02-17 07:26:36 PST ---
I think this is an enhancement.

Current attribute inference only works against template function and function
literal, not against normal function.
And non-template function insinde templated aggregate is normal function, so
the inference does not run for them.

But this is a big issue. Almost ranges in std.range should *inherit* original
range's pureness, safety, and nothrow-ness.
To implement it, with current compiler, the only way is to change *all of
member functions* in range structs to be tamplated like follows:

struct Retro(R) {
  R original;

  //auto empty(){ return original.empty; }
  auto empty()(){ return original.empty; }

  //auto front(){ return original.front; }
  auto front()(){ return original.front; }
  ...
}

...but it may introduce mess and dangerous forward reference, IMHO.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #12 from timon.g...@gmx.ch 2012-02-17 07:35:44 PST ---
An alias template is like a function template, just for aliases.

Those are all alias templates:

template A(T){alias T A;}
template B(T){alias Foo!T B;}
template C(T){alias foo.bar.Qux!T C;}
template D(T){alias Foo!(Bar!(Qux!T)) D;}

Those are functions that use them:
void fooa(T)(A!T a){ ... }
void foob(T)(B!T b){ ... }
void fooc(T)(C!T c){ ... }
void food(T)(D!T d){ ... }

Those are the versions that do exactly the same thing but work with IFTI:
void fooa(T)(T a){ ... }
void foob(T)(Foo!T b){ ... }
void fooc(T)(foo.bar.Qux!T c){ ... }
void food(T)(Foo!(Bar!(Qux!T)) d){ ... }

What I am asking for is for IFTI to work the same for the former and latter
versions of the functions. This is easy to implement and matches what most
programmers would expect the language to be capable of.

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


[Issue 7511] attribute inference does not work for methods of templated aggregates

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7511



--- Comment #2 from timon.g...@gmx.ch 2012-02-17 07:46:20 PST ---
Walter stated that this is indeed how it is supposed to work:
http://forum.dlang.org/thread/jhif48$1n0n$1...@digitalmars.com?page=3#post-jhjpfp:2419hg:242:40digitalmars.com

If it is an enhancement, then it is a high-priority one.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #13 from d...@dawgfoto.de 2012-02-17 07:47:33 PST ---
MidAir collision but thanks for the clarification.

Most of those cases can be handled by aliasing
the template declaration rather than the instance.

alias Foo Alias;
void foo(T)(Alias!T x){ pragma(msg, T); }
foo(Foo!int.init);

Which wouldn't work for recursion.
template D(T){alias Foo!(Bar!(Qux!T)) D;}

It seems to me that what you want is an AST macro not a template expansion.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #14 from Kenji Hara k.hara...@gmail.com 2012-02-17 07:59:59 PST 
---
(In reply to comment #12)
 An alias template is like a function template, just for aliases.
 
 Those are all alias templates:
 
 template A(T){alias T A;}
 template B(T){alias Foo!T B;}
 template C(T){alias foo.bar.Qux!T C;}
 template D(T){alias Foo!(Bar!(Qux!T)) D;}
 
 Those are functions that use them:
 void fooa(T)(A!T a){ ... }
 void foob(T)(B!T b){ ... }
 void fooc(T)(C!T c){ ... }
 void food(T)(D!T d){ ... }
 
 Those are the versions that do exactly the same thing but work with IFTI:
 void fooa(T)(T a){ ... }
 void foob(T)(Foo!T b){ ... }
 void fooc(T)(foo.bar.Qux!T c){ ... }
 void food(T)(Foo!(Bar!(Qux!T)) d){ ... }
 
 What I am asking for is for IFTI to work the same for the former and latter
 versions of the functions. This is easy to implement and matches what most
 programmers would expect the language to be capable of.

OK, I almost understand what you expects.

When the two declarations exist,
 template B(T){alias Foo!T B;}
 void foob(T)(B!T b){ ... }

and calling foob with IFTI like follows:
Foo!int x;
foob(x);  // foob(T)(B!T) is converted to foob(T)(Foo!T) 
  // *with expanding template B*, then foob deduces T as int.

OK?

-
There is some problems about this enhancement.

1) This enhancement requires adding a phase to expanding eponymous templates
used as function parameter type. This makes IFTI process more complicate.

2) Some eponymous templates are not one liner.

template X(T) {
   template Y(U) { ... }  // massive type calculation
   alias Y!T X;   // also eponymous template
}
void foo(T)(X!T) { ... }

Should compiler calculate T from X!T? It is almost impossible!

If it only works with one-linear eponymous template, it is less benefit than
the semantic complexity.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #16 from timon.g...@gmx.ch 2012-02-17 08:06:44 PST ---
(In reply to comment #13)
 MidAir collision but thanks for the clarification.
 
 Most of those cases can be handled by aliasing
 the template declaration rather than the instance.
 
 alias Foo Alias;
 void foo(T)(Alias!T x){ pragma(msg, T); }
 foo(Foo!int.init);
 
 Which wouldn't work for recursion.
 template D(T){alias Foo!(Bar!(Qux!T)) D;}
 
 It seems to me that what you want is an AST macro not a template expansion.

IFTI matching already works that way.

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #15 from timon.g...@gmx.ch 2012-02-17 08:05:50 PST ---
(In reply to comment #14)
 
 OK?
 

Yes.

 -
 There is some problems about this enhancement.
 
 1) This enhancement requires adding a phase to expanding eponymous templates
 used as function parameter type. This makes IFTI process more complicate.
 

It can presumably be done while semantically analyzing the parameter types.

 2) Some eponymous templates are not one liner.
 
 template X(T) {
template Y(U) { ... }  // massive type calculation
alias Y!T X;   // also eponymous template
 }
 void foo(T)(X!T) { ... }
 
 Should compiler calculate T from X!T? It is almost impossible!
 

It shouldn't, because it *is* impossible.

 If it only works with one-linear eponymous template, it is less benefit than
 the semantic complexity.

I disagree. There is almost no semantic complexity.

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


[Issue 7519] std.xml cannot manage single quoted attribute values

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7519


Richard Webb we...@beardmouse.org.uk changed:

   What|Removed |Added

 CC||we...@beardmouse.org.uk


--- Comment #1 from Richard Webb we...@beardmouse.org.uk 2012-02-17 08:09:00 
PST ---
For what it's worth, a simple

string s = cast(string)std.file.read(filePath);
auto doc = new Document(s);


using the xml file attached to https://bugs.launchpad.net/d2-xml/+bug/933594

Takes ~18.6 seconds using std.xml and ~16.4 seconds using std.xml1.
The parse time drops substantially if the GC is disabled while the Document is
being created.

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


[Issue 7532] New: DMD stripping imports in header files

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7532

   Summary: DMD stripping imports in header files
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ad...@dav1d.de


--- Comment #0 from David ad...@dav1d.de 2012-02-17 08:18:24 PST ---
DMD seems to strip the part following the : in the import statement in
header-files (.di). This causes strange errors when e.g. import std.math :
sqrt and core.stdc.math : fmodf, since sqrt is also defined in
core.stdc.math.

Example:

// linalg.di - Header
private 
{
import std.math;
import std.conv;
import std.traits;
import std.string;
import std.array;
import std.algorithm;
import gl3n.math;
import gl3n.util;
}

// linalg.d - Source
private {
import std.math : isNaN, isInfinity, sqrt;
import std.conv : to;
import std.traits : isFloatingPoint, isStaticArray, isDynamicArray,
isImplicitlyConvertible;
import std.string : format, rightJustify;
import std.array : join;
import std.algorithm : max, min, reduce;
import gl3n.math : clamp, PI, abs, sin, cos, acos, tan, asin, atan2;
import gl3n.util : is_vector, is_matrix, is_quaternion;
}

gl3n.math imports core.stdc.math : fmodf publically which caused strange
error messages:

Error: std.math.sqrt at
MeinPfadZuD_Root\dmd2\windows\bin\..\..\src\phobos\std\math.d(874) conflicts
with __anonymous at 

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


[Issue 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529



--- Comment #17 from d...@dawgfoto.de 2012-02-17 08:44:58 PST ---
IFTI matching already works that way.
No it does not.

With IFTI and structs you recursively match template arguments.
Foo!(Bar!(Baz!T)))
Foo!(Bar!(Baz!int)))

With the alias you need to instantiate the template, probably using a bottom
type and then do the above.
Foo!(Bar!(Baz!(T))) = Result!T
Result!int

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


[Issue 7533] New: Error with no line number with pure static ctor

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7533

   Summary: Error with no line number with pure static ctor
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-02-17 09:55:39 PST ---
immutable struct Foo(int n) {
pure static this() {}
}
void main() {
Foo!5 foo;
}


DMD 2.058 gives:

Error: pure function '_staticCtor2' cannot access mutable static data '__gate'
test2.d(5): Error: template instance test2.Foo!(5) error instantiating

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


[Issue 7433] writeln of char range

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7433


simendsjo simend...@gmail.com changed:

   What|Removed |Added

 CC||simend...@gmail.com


--- Comment #1 from simendsjo simend...@gmail.com 2012-02-17 10:45:32 PST ---
Perhaps http://d.puremagic.com/issues/show_bug.cgi?id=7476

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


[Issue 7534] New: Allow attribute-overloading of an overridden method

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7534

   Summary: Allow attribute-overloading of an overridden method
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-02-17 11:34:45 PST ---
Also see: http://d.puremagic.com/issues/show_bug.cgi?id=3757

class C{
void foo(){}
}
class D : C{
override void foo(){}
void foo()const{}
}

Currently this is illegal. Both child class methods are assumed to override the
parent class method:

Error: D.foo multiple overrides of same function 

Only the first child class method should override the parent class method and
the second child class method would introduce an additional overload on const.

Similar observations apply to shared/immutable/inout functions.

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


[Issue 7533] Error with no line number with pure static ctor

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7533


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au


--- Comment #1 from Don clugd...@yahoo.com.au 2012-02-17 11:58:55 PST ---
That's a terrible error message. Bug 3243 is related.

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


[Issue 1807] ENHANCEMENT: Let IFTI see through templates to simple aliases

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1807


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

   What|Removed |Added

 CC||kyfo...@gmail.com


--- Comment #5 from timon.g...@gmx.ch 2012-02-17 14:20:38 PST ---
*** Issue 7529 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 7529] IFTI does not support template argument dependent template alias instances as parameter types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7529


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #19 from timon.g...@gmx.ch 2012-02-17 14:20:37 PST ---
Good catch.

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

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


[Issue 7527] [CTFE] Segfault when slicing a pointer at compile time

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7527


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
16:04:25 PST ---
https://github.com/D-Programming-Language/dmd/pull/728

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


[Issue 7527] [CTFE] Segfault when slicing a pointer at compile time

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7527



--- Comment #2 from github-bugzi...@puremagic.com 2012-02-17 16:05:26 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/df8183e4046793b5d5cb61bf96a16eb94c7ac2e3
fix Issue 7527 - [CTFE] Segfault when slicing a pointer at compile time

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


[Issue 7527] [CTFE] Segfault when slicing a pointer at compile time

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7527


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 3279] Confusing error message when comparing types

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3279



--- Comment #4 from github-bugzi...@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: ---


[Issue 3632] modify float is float to do a bitwise compare

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3632



--- Comment #23 from github-bugzi...@puremagic.com 2012-02-17 16:40:35 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b558967f56b3702557e5c70132e77dd05561f2e3
Merge pull request #724 from yebblies/issue3632

Issue 3632 - modify float is float to do a bitwise compare

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


[Issue 3632] modify float is float to do a bitwise compare

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3632



--- Comment #24 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
17:22:43 PST ---
change reverted - does not work

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


[Issue 7353] NRVO not properly working with inferred return type

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7353



--- Comment #6 from github-bugzi...@puremagic.com 2012-02-17 18:21:35 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/02ecef1cea5dea4f78bafb7533c896d0d9b07816
Merge pull request #722 from 9rnsr/fix7353

Issue 7353 - NRVO not properly working with inferred return type

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


[Issue 3632] modify float is float to do a bitwise compare

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3632



--- Comment #25 from yebblies yebbl...@gmail.com 2012-02-18 13:36:57 EST ---
New pull to revert the revert.

https://github.com/D-Programming-Language/dmd/pull/730

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


[Issue 7353] NRVO not properly working with inferred return type

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7353


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 6738] Can't call templatized property function from within a struct/class method

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6738


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


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


[Issue 7535] New: Position of method in code inside class/struct decides that code is proper or invalid

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7535

   Summary: Position of method in code inside class/struct decides
that code is proper or invalid
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: nazriel6...@gmail.com


--- Comment #0 from Damian Ziemba nazriel6...@gmail.com 2012-02-17 20:42:09 
PST ---
Greetings.

I've faced strange behaviour while working on my project.


// First snipped
//---
struct IrcEvent(T)
{
private T[] _container;

bool opOpAssign(string op, R)(R dlg)
if (op == +)
{
_container ~= dlg;

return true;
}
}

class IrcClient
{
public IrcEvent!(void delegate(string)) OnMessageReceived;
}


class Foo
{
static public void Dispatch(IrcClient session)
{
auto operator = new Foo;
session.OnMessageReceived += operator.Dispatch;
}

public void Dispatch(string msg)
{
}
}

void main()
{
auto irc = new IrcClient;
Foo.Dispatch(irc);
}
//---

Compiler refuse to compile this code with such message:

//---
./test.d(10): Error: cannot append type void delegate(IrcClient session) to
type void delegate(string)[]
./test.d(27): Error: template instance test.IrcEvent!(void
delegate(string)).IrcEvent.opOpAssign!(+,void delegate(IrcClient session))
error instantiating
//---

But when I change position of Dispatch methods in Foo class...

//Second source
//---
struct IrcEvent(T)
{
private T[] _container;

bool opOpAssign(string op, R)(R dlg)
if (op == +)
{
_container ~= dlg;

return true;
}
}

class IrcClient
{
public IrcEvent!(void delegate(string)) OnMessageReceived;
}


class Foo
{
public void Dispatch(string msg)
{
}

static public void Dispatch(IrcClient session)
{
auto operator = new Foo;
session.OnMessageReceived += operator.Dispatch;
}
}

void main()
{
auto irc = new IrcClient;
Foo.Dispatch(irc);
}
//---

Compiler doesn't complain!
The only difference between those 2 code snippets is position of Dispatch
method. 
In first code example non-static version of method is under static version and
in second example static version of method is under non-static version.

In my opinion this is a bug, compiler should look at methods definitions and
try to fit delegate not fail on first attempt.


Best regards,
Damian Ziemba

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


[Issue 7536] New: ctfeAdrOnStack triggered

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7536

   Summary: ctfeAdrOnStack triggered
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: marci...@gmail.com


--- Comment #0 from marci...@gmail.com 2012-02-17 20:43:08 PST ---
The code is a simplified version of code that used to work in dmd 2.055. I just
tried it with 2.058 and received
--
dmd: interpret.c:100: void CtfeStack::setValue(VarDeclaration*, Expression*):
Assertion `v-ctfeAdrOnStack = 0  v-ctfeAdrOnStack  stackPointer()'
failed.
--

import std.conv;

// Create a string that unrolls the given expression N times replacing the
// idx char ('i' by default) with the loop number in the expression each time
string unroll(size_t N, size_t i = 0)(string expr, char idx='i') {
static if (i  N) {
string subs_expr;
foreach (c; expr) {
if (c==idx) { 
subs_expr ~= to!string(i); 
} else {
subs_expr ~= c;
}
}
return subs_expr ~ \n ~ unroll!(N,i+1)(expr,idx);
}
return ;
}

struct VectorT(T, int N)
{
T[N] values_;

// triggers CTFE error
bool opEquals(const ref VectorT!(T, N) _rhs) const {
const string expr = if(values_[z]!=_rhs.values_[z]) return 0;;
mixin( unroll!(N)(expr,'z') );
return 1;
}
}

void main(string[] args)
{
alias VectorT!(double,3) Vec3; // triggers CTFE error
}

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


[Issue 7536] ctfeAdrOnStack triggered

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7536


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 CC||bra...@puremagic.com
   Severity|normal  |regression


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


[Issue 7463] Duplicated error message with bad template value parameter

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7463


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
22:59:58 PST ---
https://github.com/D-Programming-Language/dmd/pull/704

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


[Issue 7463] Duplicated error message with bad template value parameter

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7463



--- Comment #2 from github-bugzi...@puremagic.com 2012-02-17 23:02:02 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/113d2a0858fe701f120fd00522411a4c42a55ad2
fix Issue 7463 - Duplicated error message with bad template value parameter

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


[Issue 7462] Error message with _error_ in overridden function

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7462


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
23:04:50 PST ---
https://github.com/D-Programming-Language/dmd/pull/704

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


[Issue 6699] More cases of __error in error messages

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6699


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
23:06:22 PST ---
https://github.com/D-Programming-Language/dmd/pull/704

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


[Issue 6699] More cases of __error in error messages

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6699



--- Comment #5 from github-bugzi...@puremagic.com 2012-02-17 23:06:55 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f81214cbdda5fe8080418e4ffed80a90f3c076fd
fix issue 6699, fix issue 7462

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


[Issue 7462] Error message with _error_ in overridden function

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7462


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
23:08:14 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f81214cbdda5fe8080418e4ffed80a90f3c076fd
fix issue 6699, fix issue 7462

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


[Issue 6699] More cases of __error in error messages

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6699


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 7444] Require [] for array copies too

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7444


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2012-02-17 
23:27:14 PST ---
The enhancement is to disallow:

  sa = da; // use sa[] = da[] instead
  sa = e;  // use sa[] = e instead

I'm not sure this is worth the existing code breakage.

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


[Issue 7406] tuple foreach doesn't work with mixed tuples

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7406



--- Comment #2 from github-bugzi...@puremagic.com 2012-02-17 23:29:23 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/992fe402c66b554253ecc8c624a336f6e372e017
Merge pull request #667 from 9rnsr/fix7406

Issue 7406 - tuple foreach doesn't work with mixed tuples

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


[Issue 6236] Subtle bug with Windows timer, hashes and imports

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6236


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WORKSFORME


--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-02-17 
23:33:54 PST ---
I can't reproduce it anymore, even with the older 2.053. If/When I have a
reduced test case I'll open a new report.

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


[Issue 7406] tuple foreach doesn't work with mixed tuples

2012-02-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7406



--- Comment #3 from github-bugzi...@puremagic.com 2012-02-17 23:53:49 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/14e3bb9c533c178478c7b8a002b8dc05d58f722f
fix Issue 7406 - tuple foreach doesn't work with mixed tuples

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