-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from sjrd/add-tests-from-old-branches
Add tests from old branches
- Loading branch information
Showing
5 changed files
with
95 additions
and
12 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
17 changes: 17 additions & 0 deletions
17
test-sources/src/main/scala/javadefined/JavaShadowingClassChild.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,17 @@ | ||
package javadefined; | ||
|
||
public class JavaShadowingClassChild extends JavaShadowingClassParent { | ||
public class InnerClass { | ||
public int bar() { | ||
return 2; | ||
} | ||
} | ||
|
||
public InnerClass makeChildInnerClass() { | ||
return new InnerClass(); | ||
} | ||
|
||
public JavaShadowingClassParent.InnerClass makeOtherParentInnerClass() { | ||
return new JavaShadowingClassParent.InnerClass(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test-sources/src/main/scala/javadefined/JavaShadowingClassParent.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 @@ | ||
package javadefined; | ||
|
||
public class JavaShadowingClassParent { | ||
public class InnerClass { | ||
public int foo() { | ||
return 1; | ||
} | ||
} | ||
|
||
public InnerClass makeParentInnerClass() { | ||
return new InnerClass(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
test-sources/src/main/scala/simple_trees/JavaClassShadowing.scala
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,25 @@ | ||
package simple_trees | ||
|
||
import javadefined.{JavaShadowingClassChild, JavaShadowingClassParent} | ||
|
||
class JavaClassShadowing: | ||
def test(): Unit = | ||
val child: JavaShadowingClassChild = new JavaShadowingClassChild | ||
|
||
val parentInner = child.makeParentInnerClass() | ||
useParentInner(parentInner) | ||
|
||
// For some reason, this does not compile: | ||
//val otherParentInner = child.makeOtherParentInnerClass() | ||
//useParentInner(otherParentInner) | ||
|
||
val childInner = child.makeChildInnerClass() | ||
useChildInner(childInner) | ||
end test | ||
|
||
def useParentInner(parentInner: JavaShadowingClassParent#InnerClass): Unit = | ||
() | ||
|
||
def useChildInner(childInner: JavaShadowingClassChild#InnerClass): Unit = | ||
() | ||
end JavaClassShadowing |