« Return to Thread: annotations or traits to better scale scala up

Re: annotations or traits to better scale scala up

by Marcus Downing :: Rate this Message:

Reply to Author | View in Thread

Marcus Downing wrote:
I see two sides to this...
Ahem.

The second is that assignments to an inferred type would jump down to the next valid type.

    val map = new HashMap()
    //  map: Map

In cases where this is ambiguous or insufficient, it may prove necessary to specify the preferred type for the val or var.

    @InferenceDelegate{Map}
    class HashMap...

 « Return to Thread: annotations or traits to better scale scala up