[Issue 8367] New: std.range.chain's template constraint is inadequate

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

   Summary: std.range.chain's template constraint is inadequate
   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-07-10 00:18:01 
PDT ---
This code fails to compile

import std.algorithm;
import std.range;

struct Foo {}

void main()
{
auto f = Foo();
auto foos = [f];
auto foo = foos.map!(x = foo);
auto bar = foo.chain(bar);
}

giving this string of errors:

/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1934): Error: cannot
have parameter of type void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1934): Error:
variable std.range.chain!(Result,string).chain.Result.fixRef.val variables
cannot be of type void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1936): Error: cannot
return non-void from void function
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1996): Error:
function std.range.chain!(Result,string).chain.Result.fixRef (void val) is not
callable using argument types (string)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1996): Error: cannot
implicitly convert expression (this.source._field_field_0.front()) of type
string to void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1996): Error:
function std.range.chain!(Result,string).chain.Result.fixRef (void val) is not
callable using argument types (dchar)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(1996): Error: cannot
implicitly convert expression (front(this.source._field_field_1)) of type dchar
to void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2026): Error: cannot
return non-void from void function
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2026): Error: cannot
return non-void from void function
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2039): Error:
function std.range.chain!(Result,string).chain.Result.fixRef (void val) is not
callable using argument types (dchar)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2039): Error: cannot
implicitly convert expression (back(this.source._field_field_1)) of type dchar
to void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2039): Error:
function std.range.chain!(Result,string).chain.Result.fixRef (void val) is not
callable using argument types (string)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2039): Error: cannot
implicitly convert expression (this.source._field_field_0.back()) of type
string to void
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2061): Error: cannot
return non-void from void function
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/range.d(2061): Error: cannot
return non-void from void function
q.d(11): Error: template instance std.range.chain!(Result,string) error
instantiating

The code shouldn't compile. It's trying to chain an array of strings and a
string. The types don't match. However, the error is _horrible_. Since the
given arguments won't compile with chain, they shouldn't pass chain's template
constraint (either that or chain must have a series of static asserts which
output informative error messages for types which won't work with chain). But
obviously, chain's template constraint is passing with arguments which fail to
compile with chain, and that needs to be fixed.

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


[Issue 8368] New: std.algorithm.sort's template constraint is inadequate

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

   Summary: std.algorithm.sort's template constraint is inadequate
   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-07-10 00:24:37 
PDT ---
This code fails to compile

import std.algorithm;

void main()
{
auto str = [foo, bar].map!(x = x);
auto f = str.sort();
}

giving this string of errors

/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7272): Error:
r[i2] is not an lvalue
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7273): Error:
r[i1] is not an lvalue
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7201): Error:
template instance std.algorithm.swapAt!(Result) error instantiating
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7285):   
instantiated from here: getPivot!(binaryFun,Result)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7034):   
instantiated from here: sortImpl!(binaryFun,cast(SwapStrategy)0,Result)
q.d(8):instantiated from here: sort!(a 
b,cast(SwapStrategy)0,Result)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7285): Error:
template instance std.algorithm.getPivot!(binaryFun,Result) error instantiating
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7034):   
instantiated from here: sortImpl!(binaryFun,cast(SwapStrategy)0,Result)
q.d(8):instantiated from here: sort!(a 
b,cast(SwapStrategy)0,Result)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7239): Error:
r[j] is not an lvalue
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7242): Error:
r[j] is not an lvalue
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7357): Error:
template instance std.algorithm.optimisticInsertionSort!(binaryFun,Result)
error instantiating
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7034):   
instantiated from here: sortImpl!(binaryFun,cast(SwapStrategy)0,Result)
q.d(8):instantiated from here: sort!(a 
b,cast(SwapStrategy)0,Result)
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/algorithm.d(7034): Error:
template instance std.algorithm.sortImpl!(binaryFun,cast(SwapStrategy)0,Result)
error instantiating
q.d(8):instantiated from here: sort!(a 
b,cast(SwapStrategy)0,Result)
q.d(8): Error: template instance std.algorithm.sort!(a 
b,cast(SwapStrategy)0,Result) error instantiating

Clearly, sort's template constraint didn't properly catch the fact that the
range being passed to map wouldn't compile with sort. sort fails to even test
that the range is a random-access range! sort needs a proper template
constraint which fails to compile with any range which won't work with it
(either that or static asserts which give informative error messages when the
type isn't going to work with sort). And some of the helper functions should
probably have proper template constraints as well - e.g. the actual line that
fails to compile is in swapAt, which has no template constraint.

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


[Issue 8276] [CTFE] ICE when reading variable from nested function

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


Don clugd...@yahoo.com.au 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 6857] Precondition contract checks should be statically bound.

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



--- Comment #81 from Stewart Gordon s...@iname.com 2012-07-10 05:05:48 PDT ---
(In reply to comment #80)
 (In reply to comment #79)
 - we have variadics that are really just C's variadics with 
 typeinfo added
 
 We also have C's variadics.

But no use case I can see for using a C-style variadic for a D class method.

 Something else I should've realised earlier: Why do D class methods 
 need to be directly callable from C?  (How does C code hold a 
 reference to a D object, anyway?)  Indeed, is even C++ designed to 
 accommodate this?
 
 COM classes defined in D are callable from C (and you could define 
 other classes the same way).

But do any COM interfaces define C-style variadic methods?  Do we need to be
open to this possibility, or are we wasting our time by worrying about it?

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


[Issue 7247] All programs segfault before main

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


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||WORKSFORME
   Severity|trivial |critical


--- Comment #10 from yebblies yebbl...@gmail.com 2012-07-11 00:43:24 EST ---
Closing as it appears to be an environment problem rather than a bug.

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


[Issue 7258] std.array.array of const items

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


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Severity|enhancement |normal


--- Comment #3 from yebblies yebbl...@gmail.com 2012-07-11 00:51:27 EST ---
I suspect the reason std.array.array does not handle this case is due to an
oversight and is not part of the design, and this is therefore a bug.

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


[Issue 7366] IFTI fails to consider bounds-checked implicit conversions for non-deduced parameter types

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


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

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


--- Comment #3 from yebblies yebbl...@gmail.com 2012-07-11 01:38:27 EST ---
*** This issue has been marked as a duplicate of issue 4953 ***

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


[Issue 4953] Regression(2.031): templates don't do implicit conversion properly

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


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

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


--- Comment #17 from yebblies yebbl...@gmail.com 2012-07-11 01:38:27 EST ---
*** Issue 7366 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 8366] Overriding const member function in conjunction with mutable overload causes a strange error

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


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

   What|Removed |Added

   Keywords||pull


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-07-10 09:48:50 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1042
https://github.com/D-Programming-Language/druntime/pull/272
https://github.com/D-Programming-Language/phobos/pull/680

I think we must kill the attribute inference for 'const' attribute. It requires
much compiler implementation cost against its little benefit.

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


[Issue 6744] Missing AA symbol with enum

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


Shahid govell...@gmail.com changed:

   What|Removed |Added

 CC||govell...@gmail.com


--- Comment #7 from Shahid govell...@gmail.com 2012-07-10 09:45:07 PDT ---
void main()
{
enum E { a=1, b=2 }

// Fail at link
// undefined reference to `_Dmain1E6__initZ'

E[ string ] fail1 = [ a:E.a, b:E.b ];

string[ E ] fail2 = [ E.a:a, E.b:b ];

// Works
enum { c=3, d=4 }
auto works1 = [ c:c , d:d  ];
auto works2 = [  c:c,  d:d ];
}
---

Bug does not happen if enum E is moved out of main to module scope.

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


[Issue 8369] New: try/finally block and float division by zero

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

   Summary: try/finally block and float division by zero
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: lomerei...@gmail.com


--- Comment #0 from Artem Tarasov lomerei...@gmail.com 2012-07-10 10:23:29 
PDT ---
The following code segfaults when I run it with rdmd bug.d 0:

import std.stdio, std.conv;

float a, b = 0.0;
void main(string[] args) {
try {
a = to!float(args[1]);
} finally {
writeln(a / b); 
}   
}

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


[Issue 8370] New: invalid deprecation error with -release -inline -noboundscheck

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

   Summary: invalid deprecation error with -release -inline
-noboundscheck
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-07-10 11:59:34 PDT ---
DMD 2.059:
$ echo '
import std.mmfile; // no symbol from there is used
import std.range, std.algorithm, std.conv;
void main(){[1,2,3].map!(n=n.to!string());}
'  source.d
$ dmd source.d
$ dmd -release -inline -noboundscheck source.d
/usr/include/x86_64-linux-gnu/dmd/phobos/std/datetime.d(29600): Error: variable
std.path.sep is deprecated
/usr/include/x86_64-linux-gnu/dmd/phobos/std/datetime.d(29601): Error: variable
std.path.sep is deprecated
/usr/include/x86_64-linux-gnu/dmd/phobos/std/path.d(2715): Error: alias
std.path.onOutOfMemoryError is deprecated

Removing any of the flags makes the code compile.

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


[Issue 8364] Allow exclamation mark in template definition

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



--- Comment #4 from David Piepgrass qwertie...@gmail.com 2012-07-10 12:31:37 
PDT ---
 Why?

Because one syntax is easier to learn than two. Timon said when I wrote my
very first function template in D, I used the proposed syntax and was confused
that it didn't work, and that makes two of us (well, I quickly realized why
the compiler complained, but my first instinct is to use !, and it feels really
dumb that I can't).

Plus, the parser might be able to handle ! more quickly, since it will know to
expect TemplateParameterList instead of Parameters.

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


[Issue 8371] New: Add a function to make a range from a sequence of elements

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

   Summary: Add a function to make a range from a sequence of
elements
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: yebbl...@gmail.com
ReportedBy: yebbl...@gmail.com


--- Comment #0 from yebblies yebbl...@gmail.com 2012-07-11 06:05:49 EST ---
As mentioned on the newsgroup, it would be useful to have a function in phobos
that can turn a bunch of values into a value type range.  What you get when you
cross tuple and chain.

foreach(x; range(23, 7, 1990)) // No allocations, unlike array literals
{
}

It could be a random access range, with slicing.
There's probably not much point in it having assignable elements.
I'll do a pull request for std.range in the next few days.
Name suggested by Andrei.

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


[Issue 8372] New: -property is broken

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

   Summary: -property is broken
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-07-10 13:13:45 PDT ---
The following code fails to compile with DMD 2.059 -property:

@property int delegate() foo(){ return ()=2; }
@property int bar(){ return 2; }
int baz(){ return 2; }

static assert(foo()==2);
static assert(!is(typeof(bar(;
static assert(baz==2);

All static assertions should compile and pass.

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


[Issue 8371] Add a function to make a range from a sequence of elements

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


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

   What|Removed |Added

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


--- Comment #1 from timon.g...@gmx.ch 2012-07-10 13:22:37 PDT ---
I think it should have assignable elements. It is trivial to support.

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


[Issue 4183] @property doesnt work with delegate return type

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


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

   What|Removed |Added

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


--- Comment #2 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 13:23:33 
PDT ---
*** Issue 8372 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 8372] -property is broken

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


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jmdavisp...@gmx.com
 Resolution||DUPLICATE


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 13:23:33 
PDT ---
If -property does strict property enforcement like it's supposed to,

static assert(baz==2);

should fail to compile, because baz is not a property. The others should indeed
pass as they are.

Regardless, this is a duplicate of two bugs: bug# 4183 and bug# 8162

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

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


[Issue 8222] Optlink crashes when debug info is enabled

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



--- Comment #1 from Rene Zwanenburg renezwanenb...@gmail.com 2012-07-10 
13:23:38 PDT ---
Today I finally managed to work around the issue. The offending line was:

auto list = _messageListeners.get(listener.type, new MessageListener[0]);

But the module containing that code hasn't been touched in months. The
workaround was as easy as replacing it with:

auto listPtr = listener.type in _messageListeners;
auto list = listPtr ? *listPtr : new MessageListener[](0);

I still haven't been able to get a similar crash with a reduced code base. I'll
document any future problems and their workarounds here to see if there's a
pattern.

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


[Issue 8372] -property is broken

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


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

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|DUPLICATE   |


--- Comment #2 from timon.g...@gmx.ch 2012-07-10 13:25:44 PDT ---
This is not a dup of issue 4183

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


[Issue 8372] -property is broken

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



--- Comment #3 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 13:26:47 
PDT ---
How so? Your first example is the same as bug# 4183, the second one is an
example of bug# 8162, and your third example is invalid.

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


[Issue 8372] -property is broken

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



--- Comment #4 from timon.g...@gmx.ch 2012-07-10 13:33:51 PDT ---
(In reply to comment #3)
 How so? Your first example is the same as bug# 4183,

bug# 4183 does not mention the -property flag.

 the second one is an example of bug# 8162,

bug# 8162 does not mention the -property flag.

 and your third example is invalid.

The third example is valid.

I assume -property is supposed to implement the correct @property semantics
without breaking old code. If I'm wrong I can close this issue and re-submit
the
third example.

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


[Issue 8373] New: IFTI fails on overloading of function vs non function template

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

   Summary: IFTI fails on overloading of function vs non function
template
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-07-10 13:39:52 PDT ---
DMD 2.059:
auto fun(T...)(T args){return 1;}
template fun(a...){auto fun(T...)(T args){return 2;}}
static assert(fun(0)==1); // error

The call matches only the first declaration, therefore the overload resolution
should succeed.

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


[Issue 8371] Add a function to make a range from a sequence of elements

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


Christophe Travert christophe.trav...@normalesup.org changed:

   What|Removed |Added

 CC||christophe.travert@normales
   ||up.org


--- Comment #2 from Christophe Travert christophe.trav...@normalesup.org 
2012-07-10 13:46:35 PDT ---
I'm not sure how should support slicing. The most economic way to implement
this range is to use a static array and an index indicated the next value.
Slicing this range would require either:
 - to store an extra index in the range... that would be sad IMHO, because it
is often not needed.
 - to return something else than a range:
   - a struct containing the static array and the slice. That seems to be
overkill.
   - a dynamic array. Then the slice would not be a value type like the range
is.

The dynamic array option is the most reasonable to me.

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


[Issue 8373] IFTI fails on overloading of function vs non function template

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


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

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 13:49:31 
PDT ---
This looks very similar to bug# 8316, but I'm not sure if it's the same thing.

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


[Issue 8372] -property is broken

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



--- Comment #5 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 13:46:37 
PDT ---
 bug# 4183 does not mention the -property flag.

On re-reading, I see that you're right on that, but it's really the same bug.


 bug# 8162 does not mention the -property flag.

Yes it does. It's even in the title.

 The third example is valid.

No, it's not, because baz is being used as a property when it's not. -property
should flag that as an error, and it does.

 I assume -property is supposed to implement the correct @property semantics
without breaking old code.

-property was introduced precisely because introducing strict property
enforcement _would_ break code. Otherwise, it would have just been put straight
into the compiler. The whole idea is to introduce -property first so that
people have a chance to fix their code before it becomes normal functionality
and to also give the compiler a chance to iron out any bugs with property
enforcement. It's the same with override except that it was introduced with -w
rather than with its own flag.

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


[Issue 8372] -property is broken

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


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||DUPLICATE


--- Comment #6 from timon.g...@gmx.ch 2012-07-10 13:49:59 PDT ---
(In reply to comment #5)
  bug# 4183 does not mention the -property flag.
 
 On re-reading, I see that you're right on that, but it's really the same bug.
 
 
  bug# 8162 does not mention the -property flag.
 
 Yes it does. It's even in the title.
 

You are right, it actually mentions it. My bad.

  The third example is valid.
 
 No, it's not, because baz is being used as a property when it's not. -property
 should flag that as an error, and it does.
 

It is not used as a property. Anyway, let's continue that discussion on the NG.

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

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


[Issue 8162] [TDPL] -property fails to give an error when a property function is called with parens

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


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

   What|Removed |Added

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


--- Comment #6 from timon.g...@gmx.ch 2012-07-10 13:49:59 PDT ---
*** Issue 8372 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 8373] IFTI fails on overloading of function vs non function template

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



--- Comment #2 from timon.g...@gmx.ch 2012-07-10 13:55:43 PDT ---
(In reply to comment #1)
 This looks very similar to bug# 8316, but I'm not sure if it's the same thing.

Thank you for looking that up, but it is a different issue.

The underlying problem in bug# 8316 is that the compiler does not interpret the
statement as a function call, and therefore the instantiation is ambiguous.

In this case the compiler errors out on the matching template with the error 
message that would be adequate if only the non-matching template was present.

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


[Issue 8316] Regression with template functions

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



--- Comment #8 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 14:10:53 
PDT ---
See also bug# 8373

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


[Issue 8374] New: One missed array literal interpretation as int[2]

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

   Summary: One missed array literal interpretation as int[2]
   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-07-10 15:18:42 PDT ---
I am not sure, but I think this code is correct:


struct Foo {
int[2] bar;
}
const(int[2]) spam() {
const Foo* x;
return true ? x.bar : [10, 20];
}
void main() {}


But DMD 2.060alpha gives:

test.d(6): Error: cannot implicitly convert expression
(cast(const(int)[])(*x).bar) of type const(int)[] to const(int[2u])

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


[Issue 8375] New: std.path.sep is deprecated

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

   Summary: std.path.sep is deprecated
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: rswhi...@googlemail.com


--- Comment #0 from rswhi...@googlemail.com 2012-07-10 15:40:43 PDT ---
Every time i compile something with -noboundscheck i get these errors:

Fehler1Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\file.d542
Fehler2Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\file.d543
Fehler3Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\file.d1968
Fehler4Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\file.d1969
Fehler5Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\datetime.d29289
Fehler6Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\datetime.d29598
Fehler7Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\datetime.d29600
Fehler8Error: variable std.path.sep is deprecated   
D:\D\dmd2\src\phobos\std\datetime.d29601

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


[Issue 6857] Precondition contract checks should be statically bound.

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



--- Comment #83 from Stewart Gordon s...@iname.com 2012-07-10 15:47:32 PDT ---
(In reply to comment #82)
 (In reply to comment #81)
 But no use case I can see for using a C-style variadic for a D class method.
 
 I dunno, maybe you want to pass the args on to vprintf or something...  Does 
 it
 really matter?

I'd got the impression that D-style variadics are directly compatible in that
respect.  But if D-style variadics were something more structured, I can see
that passing them to a C variadic function would be trivial.

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


[Issue 8374] One missed array literal interpretation as int[2]

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


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-07-10 
16:36:56 PDT ---
The type of

   [1,2]

is int[], not int[2].

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


[Issue 8374] One missed array literal interpretation as int[2]

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


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

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||timon.g...@gmx.ch
 Resolution|INVALID |


--- Comment #2 from timon.g...@gmx.ch 2012-07-10 16:56:28 PDT ---
The [1,2] / [10,20] literal implicitly converts to int[2].
It is similar to the following:

struct Foo{
short bar;
}

short spam() {
const Foo* x;
return true ? x.bar : 1;
}

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


[Issue 8374] One missed array literal interpretation as int[2]

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



--- Comment #3 from bearophile_h...@eml.cc 2012-07-10 17:49:56 PDT ---
(In reply to comment #1)
 The type of
 
[1,2]
 
 is int[], not int[2].

Usually in my bug reports I add some cases where the code works, to avoid
troubles like this one.


This works:


struct Foo {
int[2] bar;
}
int[2] spam() {
Foo* x;
return true ? x.bar : [10, 20];
}
void main() {}


This too works:


struct Foo {
int[2] bar;
}
const(int[2]) spam() {
const Foo* x;
const(int[2]) r = true ? x.bar : [10, 20];
return r;
}
void main() {}

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


[Issue 7174] Cannot use property function call as static if condition

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


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

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #2 from Jonathan M Davis jmdavisp...@gmx.com 2012-07-10 18:02:49 
PDT ---
Still in dmd 2.060HEAD (though, since the pull request hasn't been merged,
that's not exactly surprising).

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


[Issue 8376] New: 64 bit codegen bug involving dynamically indexed static array and continue statement

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

   Summary: 64 bit codegen bug involving dynamically indexed
static array and continue statement
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-07-10 20:19:02 PDT ---
DMD 2.059
void main() {
int i = 0;
int[2] a;
a[1]=1;
while(!a[0]){
if(a[i]) continue;
a[i] = 1;
}
}

The code terminates with -m32 and enters an infinite loop with -m64.
No other flags are necessary to reproduce.

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