IDEA-99196 Groovy: valueOf for Groovy enums with sinlge String arg

This commit is contained in:
Max Medvedev
2013-01-21 16:36:44 +04:00
parent c2047dd135
commit da3c033ab4
2 changed files with 18 additions and 0 deletions
@@ -86,3 +86,7 @@ contributor(ctype: 'groovy.lang.MetaClass') {
property name: 'static'
}
contributor(ctype: 'java.lang.Enum') {
method(type: psiClass.qualName, name: 'valueOf', params: [name: 'java.lang.String'], isStatic: true)
}
@@ -1494,4 +1494,18 @@ def 'a\\'bc'(){}
"a'b<caret>c"()
''', GrMethod)
}
void testValueOf() {
final valueof = resolveByText('''\
enum MyEnum {
FOO, BAR
}
MyEnum myEnum
myEnum = MyEnum.va<caret>lueOf('FOO')
''', PsiMethod)
assertEquals(valueof.parameterList.parametersCount, 1)
}
}