forked from INRIA/spoon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix dropping diamonds on constructor calls (INRIA#3362)
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/resources/noclasspath/GenericTypeEmptyDiamond.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// the purpose of this test class is to check that omitted type arguments are properly resolved in noclasspath mode | ||
import java.util.ArrayList; | ||
|
||
class GenericTypeEmptyDiamond { | ||
public static void main(String[] args) { | ||
// the context should allow the type arguments for this constructor call to be recovered | ||
GenericKnownExpectedType<Integer, String> someGeneric = new GenericKnownExpectedType<>(); | ||
// meth is an unresolved method, so there is no context to allow for inference of type arguments | ||
meth(new GenericUnknownExpectedType<>()); | ||
// same as the above, but with a generic type that is available on the classpath | ||
meth(new ArrayList<>()); | ||
} | ||
} |