Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code hover for type disjunction #1170

Closed
eric-milles opened this issue Oct 8, 2020 · 1 comment
Closed

Fix code hover for type disjunction #1170

eric-milles opened this issue Oct 8, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

Consider the following:

@groovy.transform.CompileStatic
void test(CharSequence cs) {
  if (cs instanceof Serializable) {
    cs
  }
}

The inferred type for "cs" within the if block is the type disjunction "CharSequence+Serializable". Hovering over "cs" produces an error:

java.lang.IllegalArgumentException: <UnionType:java.lang.CharSequence+java.io.Serializable>
	at org.eclipse.jdt.core.Signature.encodeQualifiedName(Signature.java:1373)
	at org.eclipse.jdt.core.Signature.encodeTypeSignature(Signature.java:1495)
	at org.eclipse.jdt.core.Signature.createCharArrayTypeSignature(Signature.java:1095)
	at org.eclipse.jdt.core.Signature.createTypeSignature(Signature.java:1293)
	at org.eclipse.jdt.core.Signature.createTypeSignature(Signature.java:1320)
	at org.eclipse.jdt.groovy.core.util.GroovyUtils.getTypeSignatureWithoutGenerics(GroovyUtils.java:259)
	at org.eclipse.jdt.groovy.core.util.GroovyUtils.getTypeSignature(GroovyUtils.java:202)
	at org.codehaus.groovy.eclipse.codebrowsing.requestor.CodeSelectRequestor.handleMatch(CodeSelectRequestor.java:254)
	at org.codehaus.groovy.eclipse.codebrowsing.requestor.CodeSelectRequestor.acceptASTNode(CodeSelectRequestor.java:144)
@eric-milles eric-milles added this to the v4.0.0 milestone Oct 8, 2020
@eric-milles eric-milles added the bug label Oct 8, 2020
@eric-milles eric-milles self-assigned this Oct 8, 2020
@eric-milles eric-milles changed the title Fix code hover for type disjunction flow type Fix code hover for type disjunction Oct 8, 2020
@eric-milles
Copy link
Member Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant