expected type for expression inside annotation arg can't be array type (IDEA-150564)

This commit is contained in:
Anna Kozlova
2016-01-22 14:29:01 +03:00
parent 7f0a543d1f
commit ded792b1f7
3 changed files with 50 additions and 8 deletions
@@ -25,6 +25,40 @@ class Test {
'''
assert !myFixture.lookup
}
public void "test inside annotation argument with braces"() {
TemplateManagerImpl.setTemplateTesting(project, testRootDisposable)
myFixture.configureByText "a.java", '''
interface A {}
@SuppressWarnings({A.CON<caret>ST})
class Test {}
'''
myFixture.launchAction(myFixture.findSingleIntention("Create constant field"))
myFixture.checkResult '''
interface A {
<selection>String</selection> CONST = ;
}
@SuppressWarnings({A.CONST})
class Test {}
'''
}
public void "test inside annotation argument no braces"() {
TemplateManagerImpl.setTemplateTesting(project, testRootDisposable)
myFixture.configureByText "a.java", '''
interface A {}
@SuppressWarnings(A.CON<caret>ST)
class Test {}
'''
myFixture.launchAction(myFixture.findSingleIntention("Create constant field"))
myFixture.checkResult '''
interface A {
<selection>String</selection> CONST = ;
}
@SuppressWarnings(A.CONST)
class Test {}
'''
}
public void "test insert presentable name when showing type lookup"() {
TemplateManagerImpl.setTemplateTesting(project, testRootDisposable)