Auto-conversion in array literals?

bearophile bearophileHUGS at lycos.com
Mon Jun 11 15:55:37 PDT 2012


This is valid Scala code:

object Main {
     def main(args: Array[String]): Unit = {
         val a: List[BigInt] = List(1, BigInt(2))
     }
}


Is it possible/meaningful to support/allow D code like this?

import std.bigint;
void main() {
     BigInt[] a = [1, BigInt(2)];
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list