Last active
March 4, 2016 02:31
-
-
Save robfletcher/d9207087ca9665bfa0da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.* | |
@CompileStatic | |
Map<String, ?> makeMap() { | |
def map = [string: "string"] | |
map.number = 1 | |
return map | |
} | |
def map = makeMap() | |
map.each { println it.value.getClass().name } |
println map.number.getClass().name
immediately after line 6 prints as String.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is weird. I have also noticed it works for initialization like below: