On 08/28/2010 07:19 PM, Jesse Phillips wrote:
D uses the last element in the array literal to select the type. I think there
was a discussion on why a common type wasn't used, but don't remember the
conclusion. It would be nice if it used the item you are assigning to and check
they can convert to it.
According to TDPL (page 40), common type should be used:
"The element type of the array is determined by agreement among all
elements of the
array, which is computed by means of the conditional operator ? :
(anticipating ยง 2.3.16)."