Not that it's an issue - as I can't see why that signature would ever be needed.
brianTue 29 Sep 2015
But led me to the interesting observation that MapType, and hence Maps in general, can't truly be nullable:
Subtle differences, but you need to separate the parameterized type of a Map instance versus a type signature - they are two separate things. For example this is allowed:
[Int:Int]? someMethod() { return null }
The method returns a map types Int:Int or null. However a given map instance by definition cannot be nullable. So the map type associated with it is non-nullable by definition.
SlimerDudeTue 29 Sep 2015
Okay, that makes sense - thanks for the explanation!
SlimerDude Tue 29 Sep 2015
Hi, I'm nit-picking here and I've largely written this for documentation reasons, but the following gives a compilation Err:
I tried creating one at runtime but got an
ArgErr
:This patch fixes the
ArgErr
:But led me to the interesting observation that
MapType
, and hence Maps in general, can't truly be nullable:Not that it's an issue - as I can't see why that signature would ever be needed.
brian Tue 29 Sep 2015
Subtle differences, but you need to separate the parameterized type of a Map instance versus a type signature - they are two separate things. For example this is allowed:
The method returns a map types Int:Int or null. However a given map instance by definition cannot be nullable. So the map type associated with it is non-nullable by definition.
SlimerDude Tue 29 Sep 2015
Okay, that makes sense - thanks for the explanation!