-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Substitute type parameters from super types of enclosing classes.
- Loading branch information
Showing
3 changed files
with
66 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
public class Issue4853Nullness { | ||
interface Interface<Q> {} | ||
|
||
static class MyClass<T> { | ||
class InnerMyClass implements Interface<T> {} | ||
} | ||
|
||
abstract static class SubMyClass extends MyClass<@Nullable String> { | ||
protected void f() { | ||
// :: error: (argument) | ||
method(new InnerMyClass()); | ||
} | ||
|
||
abstract void method(Interface<String> callback); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@SuppressWarnings("all") // Just check for crashes. | ||
public class Issue4853 { | ||
interface Interface<T> {} | ||
|
||
static class MyClass<T> { | ||
class InnerMyClass implements Interface<T> {} | ||
} | ||
|
||
abstract static class SubMyClass extends MyClass<Void> { | ||
protected void f() { | ||
method(new InnerMyClass()); | ||
} | ||
|
||
abstract void method(Interface<Void> callback); | ||
} | ||
} |