forked from scala/scala3
-
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 java typer problems with inner class references and raw types (sc…
…ala#19747) Tests changes against source dependency, Tasty dependency, and class dependency. fixes scala#19619
- Loading branch information
Showing
22 changed files
with
813 additions
and
16 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
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,65 @@ | ||
package a; | ||
|
||
public class InnerClass { | ||
|
||
public class Inner<U> { | ||
public U innerField; | ||
|
||
public Inner(U innerField) { | ||
this.innerField = innerField; | ||
} | ||
|
||
public U getInnerField() { | ||
return innerField; | ||
} | ||
} | ||
|
||
public class Outer<U> { | ||
|
||
public class Nested<V> { | ||
|
||
public U outerField; | ||
public V innerField; | ||
|
||
public Nested(U outerField, V innerField) { | ||
this.outerField = outerField; | ||
this.innerField = innerField; | ||
} | ||
|
||
public U getOuterField() { | ||
return outerField; | ||
} | ||
|
||
public V getInnerField() { | ||
return innerField; | ||
} | ||
} | ||
} | ||
|
||
public <U> Inner<U> createInner(U innerField) { | ||
return new Inner<>(innerField); | ||
} | ||
|
||
public <U, V> Outer<U>.Nested<V> createNested(U outerField, V innerField) { | ||
Outer<U> outer = new Outer<>(); | ||
return outer.new Nested<>(outerField, innerField); | ||
} | ||
|
||
public static <U> InnerClass.Inner<U> createInnerStatic(U innerField) { | ||
InnerClass innerClass = new InnerClass(); | ||
return innerClass.new Inner<>(innerField); | ||
} | ||
|
||
public static <U, V> InnerClass.Outer<U>.Nested<V> createNestedStatic(U outerField, V innerField) { | ||
InnerClass innerClass = new InnerClass(); | ||
InnerClass.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) { | ||
} | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
sbt-test/pipelining/Yjava-tasty-paths/a/InnerClassGen.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,78 @@ | ||
package a; | ||
|
||
public class InnerClassGen<T> { | ||
|
||
public class Inner<U> { | ||
public T rootField; | ||
public U innerField; | ||
|
||
public Inner(T rootField, U innerField) { | ||
this.rootField = rootField; | ||
this.innerField = innerField; | ||
} | ||
|
||
public T getRootField() { | ||
return rootField; | ||
} | ||
|
||
public U getInnerField() { | ||
return innerField; | ||
} | ||
} | ||
|
||
public class Outer<U> { | ||
|
||
public class Nested<V> { | ||
public T rootField; | ||
public U outerField; | ||
public V innerField; | ||
|
||
public Nested(T rootField, U outerField, V innerField) { | ||
this.rootField = rootField; | ||
this.outerField = outerField; | ||
this.innerField = innerField; | ||
} | ||
|
||
public T getRootField() { | ||
return rootField; | ||
} | ||
|
||
public U getOuterField() { | ||
return outerField; | ||
} | ||
|
||
public V getInnerField() { | ||
return innerField; | ||
} | ||
} | ||
} | ||
|
||
public static class OuterStatic<U> { | ||
public static class NestedStatic<V> { | ||
} | ||
} | ||
|
||
public <U> Inner<U> createInner(T rootField, U innerField) { | ||
return new Inner<>(rootField, innerField); | ||
} | ||
|
||
public <U, V> Outer<U>.Nested<V> createNested(T rootField, U outerField, V innerField) { | ||
Outer<U> outer = new Outer<>(); | ||
return outer.new Nested<>(rootField, outerField, innerField); | ||
} | ||
|
||
public static <T, U> InnerClassGen<T>.Inner<U> createInnerStatic(T rootField, U innerField) { | ||
InnerClassGen<T> innerClassGen = new InnerClassGen<>(); | ||
return innerClassGen.new Inner<>(rootField, innerField); | ||
} | ||
|
||
public static <T, U, V> InnerClassGen<T>.Outer<U>.Nested<V> createNestedStatic(T rootField, U outerField, V innerField) { | ||
InnerClassGen<T> innerClassGen = new InnerClassGen<>(); | ||
InnerClassGen<T>.Outer<U> outer = innerClassGen.new Outer<>(); | ||
return outer.new Nested<>(rootField, outerField, innerField); | ||
} | ||
|
||
public static <T, U, V> void consumeNestedStatic(InnerClassGen<T>.Outer<U>.Nested<V> nested) { | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package a; | ||
|
||
public class RawTypes { | ||
|
||
public class C<T> { | ||
public class D<U> { | ||
} | ||
} | ||
|
||
public static void mii_Raw_Raw(RawTypes.C.D d) { | ||
} | ||
|
||
public static void mii_Raw_Raw2(C.D d) { | ||
} | ||
|
||
} |
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,2 @@ | ||
// THIS FILE EXISTS SO THAT `A.java` WILL BE COMPILED BY SCALAC | ||
package a |
Oops, something went wrong.