[Issue 3091] auto x = new shared foo does not compile

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


Kenji Hara k.hara...@gmail.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 7656] ddoc misinterprets commented parentheses in an example

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



--- Comment #2 from github-bugzi...@puremagic.com 2012-12-06 00:42:42 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/06c24c831020e6da8ad3cc6deaa1820538e73fb5
Fixes Issue 7656, Fixes Issue 7715. Escape special characters in ddoc
d code.

https://github.com/D-Programming-Language/dmd/commit/ab5258d5bcedc55dbfeeb0fb4cc4d283f184c7fd
Merge pull request #1244 from AndrejMitrovic/Fix7656

[ddoc] Issue 7656 and 7715 - ddoc must escape special characters

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


[Issue 7715] DDoc eats $1, $2, $3 etc. inside d_code section

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



--- Comment #3 from github-bugzi...@puremagic.com 2012-12-06 00:42:49 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ab5258d5bcedc55dbfeeb0fb4cc4d283f184c7fd
Merge pull request #1244 from AndrejMitrovic/Fix7656

[ddoc] Issue 7656 and 7715 - ddoc must escape special characters

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


[Issue 9116] New: Redundant field postblit call on initializing

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

   Summary: Redundant field postblit call on initializing
   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: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2012-12-06 00:44:54 PST ---
This code doesn't work es expected.

void main()
{
static struct X {
int v;
this(this) { ++v; }
}
static struct Y {
X x;
}
X x = X(1);
assert(x.v == 1);
Y y = Y(X(1));
printf(y.x.v = %d\n, y.x.v);  // print 2, but should 1
assert(y.x.v == 1); // fails
}

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


[Issue 9116] Redundant field postblit call on initializing

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


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

   What|Removed |Added

   Keywords||pull


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-12-06 00:51:59 PST ---
https://github.com/D-Programming-Language/dmd/pull/1352

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


[Issue 9112] Uniform default construction

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



--- Comment #7 from bearophile_h...@eml.cc 2012-12-06 04:37:51 PST ---
(In reply to comment #6)
 Personally, I've used it so that an integer could be null in cases where I
 needed to distinguish between having a specific value and having no value at
 all,

In D std.typecons.Nullable!int is often better than a heap-allocated int.



 Have you honestly never needed a pointer to an int?

Not that I remember.

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


[Issue 1951] Remove SFINAE

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


Jason House jason.james.ho...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #4 from Jason House jason.james.ho...@gmail.com 2012-12-06 
05:51:51 PST ---
I believe Don is right. D does not have SFINAE. Many D users simply assume that
was inherited from C++.

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


[Issue 9116] Redundant field postblit call on initializing

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



--- Comment #2 from github-bugzi...@puremagic.com 2012-12-06 06:22:47 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/943a2cb2ea5f21bd82db9cffaee0b6a520648886
fix Issue 9116 - Redundant field postblit call on initializing

https://github.com/D-Programming-Language/dmd/commit/7853b9292765b1f10277d965f921aa9915c28d67
Merge pull request #1352 from 9rnsr/fix9116

Issue 9116 - Redundant field postblit call on initializing

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


[Issue 7790] [CTFE] assignment to AA apply ref argument

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



--- Comment #2 from github-bugzi...@puremagic.com 2012-12-06 06:28:50 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/93a019d5b10dc0fdc207912d8311a7498bad0e6b
Fix issue 7790 [CTFE] assignment to AA apply ref argument

1. IndexExp: Stop copying the AA whenever it is indexed (This was horrific for
performance, as well as being wrong).
2. aaApply: If the value is 'ref', create a reference to the value.

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


[Issue 7715] DDoc eats $1, $2, $3 etc. inside d_code section

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


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Dmitry Olshansky dmitry.o...@gmail.com 2012-12-06 
07:23:42 PST ---
Thanks a bunch!

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


[Issue 9113] ICE(interpret.c): CTFE assignment to member of struct in union

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



--- Comment #3 from github-bugzi...@puremagic.com 2012-12-06 08:07:43 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/058a16cdbbe9c32cd75b2a1ea2dbfb8a0bcc45d3
Fix issue 9113 ICE(interpret.c): CTFE assignment to member of struct in union

The ICE was caused by the error being detected too late. Move the needs 'this'
pointer error message from e2ir.c into semantic, instead of creating an
invalid
expression.

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


[Issue 9117] New: format fails if opCast and this alias are both defined in an aliased struct

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

   Summary: format fails if opCast and this alias are both defined
in an aliased struct
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: pun...@coverify.org


--- Comment #0 from Puneet Goel pun...@coverify.org 2012-12-06 09:56:42 PST 
---
This is a reduced code. Does not compile with released DMD or with github
snapshot. Strangely it compiles without any error if the opCast operation is
commented out. Note that the opCast operation casts to frop, which is totally
unrelated.

struct Bar {
  Foo foo;
  alias foo this;
  string toString() {
return Bar;
  }
}

struct Frop {}

struct Foo {
  int n = 0;
  alias n this;
  T opCast (T) () if (is(T == Frop))
  {
return Frop();
  }
  string toString() {
return Foo;
  }
}

void main() {
  import std.stdio;
  Foo foo;
  writeln(foo);// no issues
  Bar bar;
  // Compiles if either the alias or opCast in Foo are commented out
  writeln(bar);// does not compile -- should just print Bar
}

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


[Issue 7790] [CTFE] assignment to AA apply ref argument

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


d...@dawgfoto.de 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 9118] New: typo in github tools repo

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

   Summary: typo in github tools repo
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: trivial
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: monarchdo...@gmail.com


--- Comment #0 from monarchdo...@gmail.com 2012-12-06 12:29:23 PST ---
This is VERY minor, but I'll still log it:

On the page:
https://github.com/D-Programming-Language/

Under the repo tools
Ancilliary tools for the D programming language compiler
This is a typo and should read:
Ancillary tools for the D programming language compiler

Although I wonder if the correct word shouldn't actually be Auxiliary.

I'd fix this myself, but we can't contribute to that...

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


[Issue 9119] New: Forward range addition to associative arrays.

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

   Summary: Forward range addition to associative arrays.
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: maidenp...@hotmail.com


--- Comment #0 from Phil Lavoie maidenp...@hotmail.com 2012-12-06 14:15:25 
PST ---
Providing a forward range to associative arrays would allow user to use
functionalities like filter and make their own (that return intelligent
ranges instead of eagerly constructing a result, then returning said result or
a range on it). It could be provided as a range property and front could
return an entry struct where entry.key is the key and entry.value is the value.

Example usage:
float[ Item ] itemsCost;
auto cheapItems = itemsCost.range.filter!a.value  5();
foreach( cheap; cheapItems ) {
  sendGiftToEnemy( cheap.key );
}

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


[Issue 9120] New: Uniform construction for array types

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

   Summary: Uniform construction for array types
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2012-12-06 16:51:45 PST ---
Spin-off issue from bug 9112.

In current, array types does not have consistency between literal syntax and
`new` syntax.

void maiin() {
  // dynamic array
  int[] da1 = [1,2,3];  // literal syntax
//int[] da2 = int[](1,2,3);  // not allowed
// because dynamic array is *always* allocated in heap?
  int[] da3 = new int[](3);  // heap-allocated int array has length 3.
// but, all elements in da2 initialized with int.init.
// we cannot give initializing elements in use of new syntax.
  int[] dax = new int[3];  // special syntax. This creates int[] has length 3.

  int[3] sa1 = [1,2,3];  // literal syntax
//int[3] sa2 = int[3](1,2,3);  // not allowed
//int[3]* sa3a = new int[3];  // impossible
  alias T = int[3];
//int[3]* sa3b = new T;.  // Error: new can only create structs, dynamic arrays
or class objects, not int[3u]'s
// - special syntax for dynamic array blocks this...

  int[string] aa1 = [a:1, b:2];  // literal syntax
//int[string] aa1 = int[string](a:1, b:2);  // not allowed
//int[string] aa2 = new int[string];  // not allowed
}

This is not serious language flaw, but I feel it is desirable which have
consistent syntax.

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


[Issue 9112] Uniform construction for built-in types

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


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

   What|Removed |Added

Summary|Uniform default |Uniform construction for
   |construction|built-in types


--- Comment #8 from Kenji Hara k.hara...@gmail.com 2012-12-06 16:55:04 PST ---
I agree with Jonathan. `new immutable int(1)` is also necessary, otherwise we
cannot initialize heap-allocated value without type-system hacking (by using
cast). I think it is one of hole in current const type system.

Therefore, for all built-in types, both stack allocating syntax (T() and T(v))
and heap allocating syntax (new T() and new T(v)) should be supported. I
changed the summary. 

But, true uniform construction cannot be implemented currently, because array
construction has some special cases.
I've opened a new issue for uniform array construction.
Issue 9120 - Uniform construction for array types

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


[Issue 9119] Forward range addition to associative arrays.

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-12-06 17:49:48 PST ---
See Issue 5075

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


[Issue 5075] std.algorithm.map/filter don't support associative arrays

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|ASSIGNED|NEW


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


[Issue 9120] Uniform construction for array types

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-12-06 18:05:57 PST ---
What exactly are the syntax changes/additions are you suggesting?


I think this syntax is better to not support this syntax:
int[] da2 = int[](1,2,3);  // not allowed

---

There are several design problems in the array syntax. Like:

Issue 3849
Issue 4703
Issue 7445


One maybe even bigger syntax problem is related to mixing fixed-sized arrays
and dynamic arrays. This is not supported (this means a dynamic array of fixed
arrays of dynamic arrays):

void main() {
auto a = new int[][3][](5, 7);
}


Currently the D syntax to create such mixes is incomplete, and I think it's not
clear enough.

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


[Issue 8408] Purity calculation should be improved

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



--- Comment #7 from bearophile_h...@eml.cc 2012-12-06 18:07:32 PST ---
(In reply to comment #6)
 Is it correct that x1 refused and x2 accepted?

I guess I have to wait or Issue 8409 to be fixed before looking for possible
troubles.

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


[Issue 6937] new with struct doesn't allow field assignment

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



--- Comment #1 from github-bugzi...@puremagic.com 2012-12-06 18:38:18 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4a22ca0053252454c5cddab2c5754b8a2f500544
fix Issue 6937 - new with struct doesn't allow field assignment

https://github.com/D-Programming-Language/dmd/commit/ee695eb92086cb73f62e7e01f019171776308435
Merge pull request #1353 from 9rnsr/fix6937

Issue 6937 - new with struct doesn't allow field assignment

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


[Issue 9120] Uniform construction for array types

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



--- Comment #2 from Kenji Hara k.hara...@gmail.com 2012-12-06 18:45:36 PST ---
(In reply to comment #1)
 What exactly are the syntax changes/additions are you suggesting?

I'm not sure what is should be chosen. This is not an exact syntax proposal,
rather a suggestion to discuss about the issue.

 I think this syntax is better to not support this syntax:
 int[] da2 = int[](1,2,3);  // not allowed

I agree that supporting it (stack-allocated dynamic array) is much difficult.

 There are several design problems in the array syntax. Like:
 
 Issue 3849
 Issue 4703
 Issue 7445
 
 
 One maybe even bigger syntax problem is related to mixing fixed-sized arrays
 and dynamic arrays. This is not supported (this means a dynamic array of fixed
 arrays of dynamic arrays):
 
 void main() {
 auto a = new int[][3][](5, 7);
 }
 
 
 Currently the D syntax to create such mixes is incomplete, and I think it's 
 not
 clear enough.

Thanks for presenting related issues.

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


[Issue 6937] new with struct doesn't allow field assignment

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2012-12-06 19:10:36 PST ---
Despite this looks like a silent little change, this is a significant
improvement in D, and it's one of the best improvements for DMD 2.061. This
removes some useless code from my D2 code base.

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


[Issue 8408] Purity calculation should be improved

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



--- Comment #8 from Kenji Hara k.hara...@gmail.com 2012-12-06 19:33:50 PST ---
(In reply to comment #6)
 Is it correct that x1 refused and x2 accepted?
 
 
 char[] foo1(int[] arr) pure {
 return new char[10];
 }
 immutable(char)[] foo2(int[] arr) pure {
 return new char[10];
 }
 void main(string[] args) {
 immutable x1 = foo1([1, 2]); // Error: cannot implicitly convert
 immutable x2 = foo2([1, 2]); // OK
 }

I'm not sure that this should be allowed.
foo1 can rewrite the elements referred from arr, then it is deduced to weak
purity. In current principle, the returned value from weak purity function
cannot be converted to immutable implicitly (it is only allowed for strong
purity function).

If you change the signature of foo1 to:

  char[] foo1(const int[] arr) pure;

Then foo1 will be deduced to strong purity, and implicit conversion to
immutable for initializing x1 will be succeeded.

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


[Issue 6937] new with struct doesn't allow field assignment

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



--- Comment #3 from bearophile_h...@eml.cc 2012-12-06 19:37:53 PST ---
(In reply to comment #2)
 Despite this looks like a silent little change, this is a significant
 improvement in D, and it's one of the best improvements for DMD 2.061. This
 removes some useless code from my D2 code base.

This is not yet allowed to remove some more boilerplate code (the new):


struct Node(T) {
T data;
Node* left, right;
}
void main() {
alias N = Node!int;
auto t1 = new N(1, new N(2, new N(3))); // OK
alias M = Node!int.__ctor; // Not OK
auto t2 = M(1, M(2, M(3)));
}

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


[Issue 6937] new with struct doesn't allow field assignment

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



--- Comment #4 from Kenji Hara k.hara...@gmail.com 2012-12-06 19:46:54 PST ---
(In reply to comment #3)
 This is not yet allowed to remove some more boilerplate code (the new):
 
 
 struct Node(T) {
 T data;
 Node* left, right;
 }
 void main() {
 alias N = Node!int;
 auto t1 = new N(1, new N(2, new N(3))); // OK
 alias M = Node!int.__ctor; // Not OK
 auto t2 = M(1, M(2, M(3)));
 }

This is completely unrelated to this issue.
Ideally __ctor should not appear in user code, and language specification would
never support it.

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


[Issue 6937] new with struct doesn't allow field assignment

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


Kenji Hara k.hara...@gmail.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 9116] Redundant field postblit call on initializing

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


Kenji Hara k.hara...@gmail.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 2486] taking address of slice rvalue is valid

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



--- Comment #6 from github-bugzi...@puremagic.com 2012-12-06 21:50:15 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/7062ce191a651ca94fc779ac646a5ef5653b4559
fix Issue 2486 - taking address of slice rvalue is valid

https://github.com/D-Programming-Language/phobos/commit/af4fea78550216647dbf3e4aaa7d89ab1b79f542
Merge pull request #989 from 9rnsr/fix2486

Issue 2486 - taking address of slice rvalue is valid

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


[Issue 9112] Uniform construction for built-in types

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


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com


--- Comment #9 from monarchdo...@gmail.com 2012-12-06 22:30:28 PST ---
(In reply to comment #1)
 This is useful in generic code:
 int n = int(10);

EXTREMELY useful. Just the other day, I was writing a unittest to cover
appender with as many types as possible, and wanted to write something along
the lines of:

//
foreach (SS; TypeTuple!(int, S0, S1, S2, S3, S4, S5, S6, S7))
{
foreach (S; TypeTuple!(SS, const(SS), immutable(SS)))
{
auto app1 = appender!(S[])();
foreach(i; 0 .. 0x2)
app1.put(S(i)); // HERE
//
Long story short: int didn't make it into the final test...

(In reply to comment #2)
 What I really want to be able to do is stuff like
 
 auto i = new int(5);
 auto j = new immutable(int)(7);
 
 Right now, you have to do nonsense like
 
 auto i = new int;
 *i = 5;

You always have the 
auto j = [cast(immutable int)5].ptr;
Trick. But that's still ugly as sin, and I'm not sure what you are actually
paying for when doing this.

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