[Issue 11926] Segmentation fault when using const in an enum

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



--- Comment #3 from github-bugzi...@puremagic.com 2014-01-14 23:27:31 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c89e6d30d4c392c9ec942e0b08b29d4eab3546ec
fix Issue 11926 - Segmentation fault when using const in an enum

https://github.com/D-Programming-Language/dmd/commit/df5b5365fbccb9c571ccce7cc43232e4f49b646c
Merge pull request #3098 from 9rnsr/fix11926

Issue 11926 - Segmentation fault when using const in an enum

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


[Issue 11926] Segmentation fault when using const in an enum

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


Iain Buclaw  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Platform|All |x86
 Resolution||FIXED
 OS/Version|All |Linux


--- Comment #4 from Iain Buclaw  2014-01-14 23:28:43 PST ---
(In reply to comment #2)
> https://github.com/D-Programming-Language/dmd/pull/3098

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

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


[Issue 11927] a good proposal

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



--- Comment #1 from galaxylang  2014-01-14 23:08:49 PST 
---
4:>template designed to compile time computing const value and types ,alias and
pure function can compulate const ,
if a funtion only have types arguments(can have but without side effect
values)just is a template to compulate types

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


[Issue 11927] New: a good proposal

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

   Summary: a good proposal
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: galaxyl...@gmail.com


--- Comment #0 from galaxylang  2014-01-14 23:02:34 PST 
---
1:>a normal dumb question is like this

autoF()
{
}
auto C(alias A)()
{
returnA();
}
auto B(A)()
{
returnA();
}
int main(string[] argv)
{
C!F();
B!F();//Error: template instance B!(F) does not match   
  // template declaration B(A)()
return 0;
}

this need change alias can accept syntax
alias B=expression;
i think C should change to B syntax,now we can talk about some enhancement

2:>lambda with template

int main(string[] argv)
{

alias f=(x)=>x+1;
f(1);
f(1.0);
return 0;
}

3:so lambda function can pass to it

automore(F)()
{
return F(1)+1;
}
int main(string[] argv)
{

alias f=(x)=>x+2;
more!(f)();
}

4:>template designed to compile time computing const value and types ,alias and
pure function can compulate const ,
if a funtion only have function and types(without side effect values)just is a
template to compulate types

autotype(bool selector,A,B)()
{
alias type=selector?A:B;
}
auto isInt(T)()
{
alias isInt=(T is int);
}
alias Fun=type(int,F1,F2);

//even more if we change syntax to 
autotype(bool selector,A,B)
{
alias type=selector?A:B;
}
auto isInt(T)
{
alias isInt=(T==int);
}
alias Fun=type(int,F1,F2);

value and type campute now morge into one syntax,template keyword maybe would
lost it's work

5:>Further,side effect value and type can in one function
auto compute(T)(T i)
{
static if(T is int)
  alias compute=1;
else
  alias compute=1.0/i;
}

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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



--- Comment #6 from github-bugzi...@puremagic.com 2014-01-14 20:36:10 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6572dbf5e87a54d06347e538c0c846b666d4bb9d
fix Issue 11925 - ICE in CompoundStatement::semantic

https://github.com/D-Programming-Language/dmd/commit/da588730546af2e3c4732d3ade25b5002997a762
Merge pull request #3099 from 9rnsr/fix11925

[REG2.065a] Issue 11925 - ICE in CompoundStatement::semantic

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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



--- Comment #5 from Kenji Hara  2014-01-14 18:50:57 PST ---
(In reply to comment #3)
> Looks like the culprit is Array::insert on a zero-length'd array.

I think Array::insert should also work for zero-length'd array.

(In reply to comment #4)
> https://github.com/D-Programming-Language/dmd/pull/3096

I opened another PR to fix logical failure in CompoundStatement::semantic.
https://github.com/D-Programming-Language/dmd/pull/3099

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


[Issue 11926] Segmentation fault when using const in an enum

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


Kenji Hara  changed:

   What|Removed |Added

   Keywords||ice, pull
   Platform|x86 |All
 OS/Version|Linux   |All


--- Comment #2 from Kenji Hara  2014-01-14 18:20:17 PST ---
https://github.com/D-Programming-Language/dmd/pull/3098

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


[Issue 11924] inout Variadic Template Parameters

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


Kenji Hara  changed:

   What|Removed |Added

   Keywords||pull, rejects-valid


--- Comment #1 from Kenji Hara  2014-01-14 18:10:06 PST ---
https://github.com/D-Programming-Language/dmd/pull/3097

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


[Issue 9741] undefined identifier with User Defined Attribute

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


Kenji Hara  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 11926] Segmentation fault when using const in an enum

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


Iain Buclaw  changed:

   What|Removed |Added

 CC||ibuc...@ubuntu.com
   Severity|normal  |major


--- Comment #1 from Iain Buclaw  2014-01-14 15:49:27 PST ---
Raising to major - a corrupt Identifier pointer causes the ICE.

{
   = {_vptr.RootObject = 0x0},
  value = 25720336,
  string = 0x5a95dc, // Unreadable address
  len = 0
}


(gdb) bt
#0  0x005a755c in Dsymbol::toChars (this=) at
../../gcc-devel/gcc/d/dfrontend/dsymbol.c:203
#1  0x005a79aa in Dsymbol::toPrettyChars (this=0x18a2720) at
../../gcc-devel/gcc/d/dfrontend/dsymbol.c:218
#2  0x005a95dc in ScopeDsymbol::multiplyDefined (loc=..., s1=0x18a28c0,
s2=0x18a2720) at ../../gcc-devel/gcc/d/dfrontend/dsymbol.c:1049
#3  0x005a96ea in Dsymbol::addMember (this=0x7fffd978, sc=0x0,
sd=0x1887610, memnum=0) at ../../gcc-devel/gcc/d/dfrontend/dsymbol.c:610
#4  0x005aadfe in EnumDeclaration::addMember (this=0x18a24a0, sc=0x0,
sd=, memnum=1) at ../../gcc-devel/gcc/d/dfrontend/enum.c:
105
#5  0x0061480e in Module::importAll (this=0x7fffd978, prevsc=0x0)
at ../../gcc-devel/gcc/d/dfrontend/module.c:659
#6  0x0065aff0 in d_parse_file () at
../../gcc-devel/gcc/d/d-lang.cc:988
#7  0x00a3a9c5 in compile_file () at ../../gcc-devel/gcc/toplev.c:547
#8  0x00a3c922 in do_compile () at ../../gcc-devel/gcc/toplev.c:1887
#9  toplev_main (argc=18, argv=0x7fffdc58) at
../../gcc-devel/gcc/toplev.c:1963
#10 0x76e43de5 in __libc_start_main (main=0x5734f0 ,
argc=18, ubp_av=0x7fffdc58, init=, fini=, rtld_fini=, stack_end=0x7fffdc48) at libc-start.c:260
#11 0x005735c8 in _start ()

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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



--- Comment #4 from Iain Buclaw  2014-01-14 15:38:36 PST ---
https://github.com/D-Programming-Language/dmd/pull/3096

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


[Issue 11926] New: Segmentation fault when using const in an enum

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

   Summary: Segmentation fault when using const in an enum
   Product: D
   Version: D2
  Platform: x86
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: michaelpm...@gmail.com


--- Comment #0 from michaelpm...@gmail.com 2014-01-14 15:32:12 PST ---
Doing:
enum {
const a = 1,
const b = 2
}

will result in a segmentation fault.

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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



--- Comment #3 from Iain Buclaw  2014-01-14 15:24:20 PST ---
Looks like the culprit is Array::insert on a zero-length'd array.

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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



--- Comment #2 from Iain Buclaw  2014-01-14 15:07:53 PST ---
What appears to happen at a cursory look:

Array::remove  => dim -= 1;
Array::insert  => realloc() corrupts array as no resize occurs
[Next Loop]
Array::remove => memmove causes ICE because 'dim' is no longer valid.

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


[Issue 11925] [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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


Iain Buclaw  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code,
   ||ice-on-valid-code
 CC||ibuc...@ubuntu.com
   Severity|normal  |regression


--- Comment #1 from Iain Buclaw  2014-01-14 15:04:06 PST ---
Another example:

void main()
{
  switch (1) {
case 1:
  goto L1;
  break;

default:
  break;
  }
  try {
L1: { }
  }
  finally {
  }
}

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


[Issue 11925] New: [2.065] [REGRESSION] ICE in CompoundStatement::semantic

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

   Summary: [2.065] [REGRESSION] ICE in
CompoundStatement::semantic
   Product: D
   Version: D1
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ibuc...@ubuntu.com


--- Comment #0 from Iain Buclaw  2014-01-14 15:02:45 PST ---
This pull:

https://github.com/D-Programming-Language/dmd/commit/c8773c166b7a131aba9c4a2656dd20a3d4a170ac#src/statement.c-P57


Broken the following code on GDC after merging the 2.065 branch:

void main()
{
  try {
try {
  L1: {}
}
finally {
}
  }
  finally {
  }
  goto L1;
}

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


[Issue 8882] map, filter, iota and zip in pure (and nothrow) functions

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



--- Comment #3 from bearophile_h...@eml.cc 2014-01-14 13:22:18 PST ---
(In reply to comment #2)

> zip can throw because of StoppingPolicy.requireSameLength, and iota(x,y,z)
> throws when z can be 0. iota(x) and iota(x,y) are nothrow.

even iota(x,y) is not nothrow for floating point arguments:


import std.range: iota;
void main() nothrow {
iota(1.0, 2.0);
}

test.d(3): Error: 'std.range.iota!(double, double).iota' is not nothrow
test.d(2): Error: function 'D main' is nothrow yet may throw

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


[Issue 11919] GitHub HEAD regression for getAttributes trait (DMD CORE DUMP)

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


Walter Bright  changed:

   What|Removed |Added

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


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


[Issue 11914] Missed tuple unpacking in foreach for cartesianProduct

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



--- Comment #2 from github-bugzi...@puremagic.com 2014-01-14 13:19:44 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7bbbed54d8fc32c1c538b5cd44a7ac5e45ea610b
fix Issue 11914 - Missed tuple unpacking in foreach for cartesianProduct

https://github.com/D-Programming-Language/dmd/commit/dce6d8cdbb972e2704ca54d4db15502dd60ea8b8
Merge pull request #3091 from 9rnsr/fix11914

[REG2.065a] Issue 11914 - Missed tuple unpacking in foreach for
cartesianProduct

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


[Issue 11914] Missed tuple unpacking in foreach for cartesianProduct

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


Walter Bright  changed:

   What|Removed |Added

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


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


[Issue 11919] GitHub HEAD regression for getAttributes trait (DMD CORE DUMP)

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



--- Comment #2 from github-bugzi...@puremagic.com 2014-01-14 13:14:42 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/94ed79b11a762bd7de509f0d3ca78c2ffe9f9a8f
fix Issue 11919 - GitHub HEAD regression for getAttributes trait (DMD CORE
DUMP)

fix insufficient error propagation in TupleExp::semantic to resolve ICE.

https://github.com/D-Programming-Language/dmd/commit/be7ec7018a49624c847023773f425f72d8772351
Merge pull request #3090 from 9rnsr/fix11919

[REG2.066a] Issue 11919 - GitHub HEAD regression for getAttributes trait (DMD
CORE DUMP)

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


[Issue 9741] undefined identifier with User Defined Attribute

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



--- Comment #2 from github-bugzi...@puremagic.com 2014-01-14 13:14:47 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fd181823a6b3e23c5bb048f086e104c56f461cb3
fix Issue 9741 - undefined identifier with User Defined Attribute

Also fixes incorrect 'undefined identifier' error in
`fail_compilation/ice11919.d`.

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


[Issue 11922] [REG2.065a] ICE on nonexistent identifier in templated auto method

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


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #3 from Walter Bright  2014-01-14 
13:11:10 PST ---
https://github.com/D-Programming-Language/dmd/pull/3094

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


[Issue 9148] 'pure' is broken

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2014-01-14 12:59:17 PST ---
Related:


void foo(const int[] a) {
int bar() pure {
return a[0];
}
}
void main() {}


DMD 2.065alpha gives (also note the duplicated error message):

test1.d(3): Error: pure nested function 'bar' cannot access mutable data 'a'
test1.d(3): Error: pure nested function 'bar' cannot access mutable data 'a'

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


[Issue 11924] New: inout Variadic Template Parameters

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

   Summary: inout Variadic Template Parameters
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: blah38...@gmail.com


--- Comment #0 from Orvid King  2014-01-14 09:03:49 PST ---
In the previous version of DMD I was using, a snapshot from right around the
release of 2.064, this compiles fine, however, in the git head, this fails to
compile with `menuItem_1.itemTitle only parameters or stack based variables can
be inout` (This is the reduced version produced by dustmite)

inout(StringType) localize(StringType)(inout StringType str, string locale)
{
return str;
}

struct __slim_Root
{
static menuItem_1(ARGS...)()
{
enum itemTitle = ARGS;
}

static content_left_1()
{
menuItem!(localize("Home", ""));
}
alias menuItem = menuItem_1;
}

Also, while I did just realize I have a small bug in my code (I'm forcing
localize to be evaluated at compile time, while I meant for it to be done at
runtime), this code should still compile.

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


[Issue 11510] Relax restriction for overlapped pointer field access in safe code/during CTFE

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


Kenji Hara  changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #4 from Kenji Hara  2014-01-14 07:37:12 PST ---
*** Issue 10035 has been marked as a duplicate of this issue. ***

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


[Issue 10035] Rebindable does not work with CTFE

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


Kenji Hara  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #1 from Kenji Hara  2014-01-14 07:37:11 PST ---
Fixed in git-head.

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

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


[Issue 7456] Purity strength not documented

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



--- Comment #3 from Don  2014-01-14 06:56:48 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > There is some debate as to whether they even should be. pure is defined 
> > quite
> > correctly in the spec. weak vs strong purity is arguably just an 
> > implementation
> > detail used for optimizations. I believe that this is Don's take on it (he's
> > both the one who came up with strong vs weak purity and the one who updated 
> > the
> > spec when pure was changed).
> > 
> > Now, weak vs strong purity inevitably comes up when people get confused by 
> > why
> > the compiler allows what are weakly pure functions to be pure (particularly
> > when compared with what TDPL says - though I think that many just look at it
> > from a functional perspective and are confused even without having read 
> > TDPL).
> > So, there is arguably merit in defining them somewhere. But I believe that
> > Don's against it. He's mentioned before that he wants the terms to go away
> > entirely.
> 
> Implicit conversion to immutable is only allowed with strongly pure functions,
> so purity strength has semantic differences, not just implementation
> differences. These must be documented.

Actually there are a lot more than two strength levels. There are pure
functions with mutable parameters, pure functions with const parameters, pure
functions with immutable parameters, and pure functions with only value
parameters.

Consider

struct S { int b; }

long [] foo( const S * s) pure

The return value will always be unique, and therefore potentially castable to
immutable, even though the input parameter isn't immutable.

At the present time, the implicit cast is only permitted when all parameters
are immutable or are value types. But at some point in the future we could
decide to extend it to any case where it's impossible to have aliasing between
parameters and return values.
I don't think there's any need to introduce terminology. Especially not "weak
pure" which is highly misleading as there are several levels of weakness.

I just used "weak" and "strong" terms to explain to Walter that 'no globals' is
the deep property of purity, whereas 'no side effects' is already handled by
the type system.

And "weakly pure" is a bit nonsensical, it's an oxymoron.

But we definitely need to explain what the implicit conversion rule is.

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


[Issue 5746] Make std.range.iota strongly pure

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



--- Comment #2 from Kenji Hara  2014-01-14 05:26:19 PST ---
(In reply to comment #1)
> Fixed in recent Phobos updated, now this compiles:
> 
> void main() pure {
> import std.range: iota;
> foreach (_; iota(10)) {}
> foreach (_; iota(1, 10)) {}
> foreach (_; iota(10, 1, -1)) {}
> }

The situation has been improved by fixing issue 10329.

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


[Issue 11864] std.variant.Variant doesn't work with CTFE

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


Don  changed:

   What|Removed |Added

   Severity|normal  |enhancement


--- Comment #1 from Don  2014-01-14 03:29:27 PST ---
> Note that the error doesn't happen if pragma(msg, a) is removed. I guess the
compiler is lazily evaluating 'a'?

No, 'a' is normally just a run-time value. By putting it in a pragma(msg),
you're asking the compiler to evaluate it at compile time. This fails because
Variant uses memcpy. This isn't a bug. Replacing the memcpy with an array slice
assignment would just cause it to fail in a different way.

Variants are intrinsically a bit nasty, they're basically a union, so there's
actually multiple reasons why they don't work in CTFE.

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


[Issue 8882] map, filter, iota and zip in pure (and nothrow) functions

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



--- Comment #2 from bearophile_h...@eml.cc 2014-01-14 03:16:34 PST ---
The situation has now improved:


import std.algorithm: map, filter;
import std.range: iota, zip;
void main() pure nothrow {
foreach (_; map!q{a * a}([1, 2, 3])) {}
foreach (_; filter!q{ a > 1 }([1, 2, 3])) {}
foreach (_; iota(1, 10, 2)) {}
foreach (_; zip([1, 2, 3], [10, 20, 30])) {}
}


test.d(6): Error: 'std.range.iota!(int, int, int).iota' is not nothrow
test.d(7): Error: 'std.range.Zip!(int[], int[]).Zip.empty' is not nothrow
test.d(7): Error: 'std.range.Zip!(int[], int[]).Zip.popFront' is not nothrow
test.d(3): Error: function 'D main' is nothrow yet may throw


zip can throw because of StoppingPolicy.requireSameLength, and iota(x,y,z)
throws when z can be 0. iota(x) and iota(x,y) are nothrow.

I think the problem with zip() can be solved introducing an api change, or
adding a new zip overload that takes StoppingPolicy as first template argument.

Fixing iota(x,y,z) is less easy. z is often a value known at compile time, so
in theory a new version of iota!z(x, y) can be nothrow at run-time.

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


[Issue 5746] Make std.range.iota strongly pure

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #1 from bearophile_h...@eml.cc 2014-01-14 03:08:09 PST ---
Fixed in recent Phobos updated, now this compiles:

void main() pure {
import std.range: iota;
foreach (_; iota(10)) {}
foreach (_; iota(1, 10)) {}
foreach (_; iota(10, 1, -1)) {}
}

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


[Issue 6411] Undefined reference to __dgliteral in mixin

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


Iain Buclaw  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WORKSFORME


--- Comment #1 from Iain Buclaw  2014-01-14 02:08:12 PST ---
Can no longer reproduce it using gdc... dunno if dmd is still not working.

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