[Issue 6276] New: [CTFE] Strange behavior of using ~= operator twice

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6276

   Summary: [CTFE] Strange behavior of using ~= operator twice
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: youx...@gmail.com


--- Comment #0 from Hisayuki Mima youx...@gmail.com 2011-07-09 01:17:00 PDT 
---
struct Foo{
int[] i;
}

bool func(){
Foo foo;
foo.i ~= 1;
foo.i ~= 2;//Compile fails on this line.
return true;
}

When I compiled this source code, compile of dmd v2.054 built from trunk
failed.

Error: foo.i ~= 2 cannot be evaluated at compile time

This may shows that operator ~= or array in CTFE has wrong behavior.

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


[Issue 6277] New: Disallow short floating point literals

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6277

   Summary: Disallow short floating point literals
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: accepts-invalid
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-07-09 05:04:51 PDT ---
This comes from bug 3837 and bug 2656


I suggest to turn floating point literals like the following into syntax
errors, because the saving of one digit is not worth the troubles they cause:
.5
3.

And require something like:
0.5
3.0


See also the thread:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learnarticle_id=28030

Daniel Murphy suggests to allow 1.f and 1.L but this a special case.

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


[Issue 3512] dchar iteration over string in CTFE fails

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3512


Johann MacDonagh johann.macdon...@gmail.com changed:

   What|Removed |Added

 CC||johann.macdon...@gmail.com


--- Comment #5 from Johann MacDonagh johann.macdon...@gmail.com 2011-07-09 
06:32:18 PDT ---
This still fails, and will most likely be fixed by issue 6268.

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


[Issue 5089] feqrel does not compile for floats

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5089


Mike Wey mike-...@planet.nl changed:

   What|Removed |Added

 CC||mike-...@planet.nl


--- Comment #1 from Mike Wey mike-...@planet.nl 2011-07-09 08:07:12 PDT ---
As far as i know Don wrote both the feqrel function in tango and phobos.
But he has only fixed the one in tango to work with floats.

See: http://www.dsource.org/projects/tango/changeset/4108

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


[Issue 4216] Class method hidden by another one warning

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4216



--- Comment #1 from bearophile_h...@eml.cc 2011-07-09 10:49:05 PDT ---
DMD 2.054beta without -w prints this:

test.d(4): Error: class test.B use of test.A.foo(A a) hidden by B is deprecated

The error message may also suggest the use of alias to solve this problem.

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


[Issue 6265] Pure-inference failed when calling other pure functions

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6265


kenn...@gmail.com changed:

   What|Removed |Added

   Keywords||patch


--- Comment #2 from kenn...@gmail.com 2011-07-09 11:06:14 PDT ---
DMD pull #222.

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

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


[Issue 5814] A bug with bitwise and among booleans

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5814


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #1 from bearophile_h...@eml.cc 2011-07-09 11:08:24 PDT ---
*** This issue has been marked as a duplicate of issue 5409 ***

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


[Issue 5409] Disallow (!x y)

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5409



--- Comment #2 from bearophile_h...@eml.cc 2011-07-09 11:08:24 PDT ---
*** Issue 5814 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 3981] More useful and more clean 'is'

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3981



--- Comment #3 from bearophile_h...@eml.cc 2011-07-09 11:14:03 PDT ---
Bug 3632 implements this for floating point values (it's not truly bitwise when
they are NaN).

some_struct is some_struct seems useful.

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


[Issue 2740] Template Mixins do not work as advertised

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2740


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

   What|Removed |Added

   Keywords||patch
 CC||k.hara...@gmail.com


--- Comment #7 from Kenji Hara k.hara...@gmail.com 2011-07-09 16:45:34 PDT ---
https://github.com/D-Programming-Language/dmd/pull/223

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


[Issue 6278] New: 'in' contract inheritance doesn't work with safe code

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6278

   Summary: 'in' contract inheritance doesn't work with safe code
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: michel.for...@michelf.com


--- Comment #0 from Michel Fortin michel.for...@michelf.com 2011-07-09 
22:00:30 EDT ---
This code yields an error about catching Throwable in safe code, yet no
throwable are caught (except maybe in compiler-generated code related to
contracts):

@safe:

class A {
int test()
in { assert(0); }
body { return 1; }
}
class B : A {
override int test() // Error: can only catch class objects derived from
Exception in @safe code, not 'object.Throwable'
in { assert(0); }
body { return 1; }
}

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


[Issue 6279] New: array-vararg with pointer type not working in safe code

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6279

   Summary: array-vararg with pointer type not working in safe
code
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: michel.for...@michelf.com


--- Comment #0 from Michel Fortin michel.for...@michelf.com 2011-07-09 
22:10:27 EDT ---
This code doesn't work in @safe mode because of some compiler-generated code
not being @safe:

@safe:

void foo(string[] val...) {
}

void main() {
foo(a, b); // Error: variable voidinitvararg.main.__arrayArg3 void
initializers for pointers not allowed in safe functions
}

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


[Issue 1913] Template error message reports correct line # but wrong file

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1913


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||k.hara...@gmail.com
 Resolution||FIXED


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-07-09 20:13:48 PDT ---
As Russ says in comment #2, now Error message is correct (dmd 45cc9c5).

b.d(5): Error: mixin T isn't a template
a.d(7): Error: template instance a.main.foo!(bar) error instantiating


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


[Issue 6264] ICE on testing opSlice in static if

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6264


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||patch
 CC||yebbl...@gmail.com


--- Comment #1 from yebblies yebbl...@gmail.com 2011-07-10 14:32:18 EST ---
https://github.com/D-Programming-Language/dmd/pull/224

The static if(is(typeof( is unnecessary.  The compiler will assert rather than
give an error.

This was caused by the fix to bug 5284.

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


[Issue 4460] Regression(2.036) ICE(e2ir.c) when compiling foreach over associative array literal

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4460


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #9 from yebblies yebbl...@gmail.com 2011-07-10 15:04:57 EST ---
https://github.com/D-Programming-Language/dmd/pull/221

This also re-enables the check that the index is not ref, and a couple of
others.

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


[Issue 6278] Regression(2.054 beta): 'in' contract inheritance doesn't work with safe code

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6278


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||rejects-valid
 CC||yebbl...@gmail.com
Summary|'in' contract inheritance   |Regression(2.054 beta):
   |doesn't work with safe code |'in' contract inheritance
   ||doesn't work with safe code
   Severity|normal  |regression


--- Comment #1 from yebblies yebbl...@gmail.com 2011-07-10 15:43:47 EST ---
Yep, the compiler generates a bunch of nested try {} catch {} blocks in the
function preconditions.

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


[Issue 6267] Regression(2.054 beta): Can't increment alias this'd struct from ref return

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6267


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||patch
 CC||yebbl...@gmail.com
Summary|Can't increment alias   |Regression(2.054 beta):
   |this'd struct from ref  |Can't increment alias
   |return  |this'd struct from ref
   ||return


--- Comment #2 from yebblies yebbl...@gmail.com 2011-07-10 15:48:37 EST ---
https://github.com/D-Programming-Language/dmd/pull/225

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


[Issue 6278] Regression(2.054 beta): 'in' contract inheritance doesn't work with safe code

2011-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6278



--- Comment #2 from yebblies yebbl...@gmail.com 2011-07-10 15:53:01 EST ---
(In reply to comment #1)
 Yep, the compiler generates a bunch of nested try {} catch {} blocks in the
 function preconditions.

I think the correct change here is to introduce a new exception type
(ContractException?) and hook the assert handler to throw this when inside
contracts.  Currently the compiler will take OutOfMemoryError as a contract
failure and happily continue.

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