-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In Java sources, allow a non-stable prefix for a class parent.
(If we widen Foo.this.Inner in the parents of a class to AbstractFoo#Inner, i.e. an inherited class Inner prefixed by its owner abstract class AbstractFoo, this is not considered a stable prefix for a class parent type. But in Java this is the correct type so allow it.)
- Loading branch information
1 parent
e8e295a
commit d37857c
Showing
5 changed files
with
149 additions
and
4 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
52 changes: 52 additions & 0 deletions
52
sbt-test/pipelining/Yjava-tasty-paths/a/InnerClassSub.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,52 @@ | ||
package a; | ||
|
||
public class InnerClassSub extends InnerClass { | ||
|
||
public class InnerSub<U> extends Inner<U> { | ||
public InnerSub(U innerField) { | ||
super(innerField); | ||
} | ||
} | ||
|
||
public class OuterSub<U> extends Outer<U> { | ||
public OuterSub() { | ||
super(); | ||
} | ||
} | ||
|
||
public <U> Inner<U> createInnerSub(U innerField) { | ||
return new InnerSub<>(innerField); | ||
} | ||
|
||
public <U, V> Outer<U>.Nested<V> createNestedSub(U outerField, V innerField) { | ||
OuterSub<U> outer = new OuterSub<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public <U> InnerClass.Inner<U> createInnerSub2(U innerField) { | ||
return new InnerSub<>(innerField); | ||
} | ||
|
||
public <U, V> InnerClass.Outer<U>.Nested<V> createNestedSub2(U outerField, V innerField) { | ||
OuterSub<U> outer = new OuterSub<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public static <U> InnerClass.Inner<U> createInnerStatic(U innerField) { | ||
InnerClassSub innerClass = new InnerClassSub(); | ||
return innerClass.new Inner<>(innerField); | ||
} | ||
|
||
public static <U, V> InnerClass.Outer<U>.Nested<V> createNestedStatic(U outerField, V innerField) { | ||
InnerClassSub innerClass = new InnerClassSub(); | ||
InnerClassSub.Outer<U> outer = innerClass.new Outer<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public static <U, V> void consumeNestedStatic(InnerClass.Outer<U>.Nested<V> nested) { | ||
} | ||
|
||
public static <U, V> void consumeNestedStatic2(Outer<U>.Nested<V> nested) { | ||
} | ||
|
||
} |
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,54 @@ | ||
// InnerClass.java | ||
|
||
package lib; | ||
|
||
public class InnerClassSub extends InnerClass { | ||
|
||
public class InnerSub<U> extends Inner<U> { | ||
public InnerSub(U innerField) { | ||
super(innerField); | ||
} | ||
} | ||
|
||
public class OuterSub<U> extends Outer<U> { | ||
public OuterSub() { | ||
super(); | ||
} | ||
} | ||
|
||
public <U> Inner<U> createInnerSub(U innerField) { | ||
return new InnerSub<>(innerField); | ||
} | ||
|
||
public <U, V> Outer<U>.Nested<V> createNestedSub(U outerField, V innerField) { | ||
OuterSub<U> outer = new OuterSub<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public <U> InnerClass.Inner<U> createInnerSub2(U innerField) { | ||
return new InnerSub<>(innerField); | ||
} | ||
|
||
public <U, V> InnerClass.Outer<U>.Nested<V> createNestedSub2(U outerField, V innerField) { | ||
OuterSub<U> outer = new OuterSub<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public static <U> InnerClass.Inner<U> createInnerStatic(U innerField) { | ||
InnerClassSub innerClass = new InnerClassSub(); | ||
return innerClass.new Inner<>(innerField); | ||
} | ||
|
||
public static <U, V> InnerClass.Outer<U>.Nested<V> createNestedStatic(U outerField, V innerField) { | ||
InnerClassSub innerClass = new InnerClassSub(); | ||
InnerClassSub.Outer<U> outer = innerClass.new Outer<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public static <U, V> void consumeNestedStatic(InnerClass.Outer<U>.Nested<V> nested) { | ||
} | ||
|
||
public static <U, V> void consumeNestedStatic2(Outer<U>.Nested<V> nested) { | ||
} | ||
|
||
} |
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