Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 12, 2020 12:34
Show Gist options
  • Save ch8n/c344148d76bc66d9f63275dd44bf34b8 to your computer and use it in GitHub Desktop.
Save ch8n/c344148d76bc66d9f63275dd44bf34b8 to your computer and use it in GitHub Desktop.
empty map resolving
fun <K, V> mapOf(): Map<K, V> = emptyMap()
// emptyMap is resolved by
object EmptyMap : Map<Any?, Nothing>, Serializable
// which return read-only empty map implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment