Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Nov 25, 2019
1 parent 9c9d32b commit bdf2156
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,23 @@ final class ConstructorCompletionTests extends CompletionTestSuite {
proposalExists(proposals, 'aaa : __', 0)
}

@Test // https://github.com/groovy/groovy-eclipse/issues/991
void testNamedArgs18() {
String contents = '''\
class Foo {
String abc
}
new Foo(abc: "xyz")
'''.stripIndent()

ICompletionProposal[] proposals = createProposalsAtOffset(contents, getLastIndexOf(contents, 'abc: '))
/* java.lang.NullPointerException
at org.codehaus.groovy.eclipse.codeassist.processors.TypeCompletionProcessor.doTypeCompletion(TypeCompletionProcessor.java:133)
at org.codehaus.groovy.eclipse.codeassist.processors.TypeCompletionProcessor.generateProposals(TypeCompletionProcessor.java:71)
at org.codehaus.groovy.eclipse.codeassist.requestor.GroovyCompletionProposalComputer.computeCompletionProposals(GroovyCompletionProposalComputer.java:221)
*/
}

@Test // explicit no-arg and tuple constructors exist
void testNoNamedArgs() {
String contents = '''\
Expand Down

0 comments on commit bdf2156

Please sign in to comment.