maybe include it on the list and map interfaces? ...
# language-proposals
g
maybe include it on the list and map interfaces?
Copy code
interface List{
  companion object{
    operator fun <T> get(vararg x: T): List<out T> = x.toList()
  }
}
then I believe this will work
Copy code
val x = List[1, 2, 3]
val y = Map[1 to "a", 2 to "b"]
but is
List[]
really any nicer than
listOf()
? I suppose now you can ctrl + click on
List
and get to the interface definition rather than the function.