eclipse-jdt / eclipse-jdt/eclipse.jdt.core

Should TypeVariableBinding answer true for isClass() ?

Open
#3,040 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
49

Description

I was surprised by TypeVariableBinding.isClass() answering true in org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.getAllEnumerableReferenceTypes() (the only call there)

Because it answers true and because it is not abstract, it gets added to permitted subtypes set in:

```
if (isClass() && (!isAbstract()))
permSet.add(this);
```
which causes bad things to happen down the road.

Perhaps the block should instead read:

```
if (isClass() && canBeInstantiated())
permSet.add(this);
```

The latter would address the problem I presently have, but this ticket is for the larger question. Should TVB answer true for isClass() ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.