Skip to content

Commit

Permalink
Merge pull request #699 from armanbilge/topic/public-trait-loses-meth…
Browse files Browse the repository at this point in the history
…od-becomes-package-private-nok
  • Loading branch information
dwijnand authored Aug 3, 2022
2 parents bc2729c + 6625c95 commit 295754c
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object Analyzer {
}

def analyze(oldclazz: ClassInfo, newclazz: ClassInfo, log: Logging, excludeAnnots: List[AnnotInfo]): List[Problem] = {
if ((if (newclazz.isModuleClass) newclazz.module else newclazz).isScopedPrivate) Nil
if ((if (oldclazz.isModuleClass) oldclazz.module else oldclazz).isScopedPrivate) Nil
else {
TemplateChecker.check(oldclazz, newclazz) match {
case p @ Some(_: IncompatibleTemplateDefProblem | _: CyclicTypeReferenceProblem) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object App {
def main(args: Array[String]): Unit = {
println(foo.Lib.doIt)
println(new foo.Foo().bar(1))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
method bar(Int)Int in class foo.Foo does not have a correspondent in new version
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package foo

class Foo {
def bar(x: Int) = x
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@ package foo
private[foo] class Foo {
def bar(x: Int, y: Int) = x + y
}

object Lib {
val foo = new Foo
def doIt = foo.bar(1, 0)
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
object App {
def main(args: Array[String]): Unit = {
println(new bar.A() {}.foo(App))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
method foo(java.lang.Object)java.lang.Object in trait bar.A does not have a correspondent in new version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
method foo(java.lang.Object)java.lang.Object in interface bar.A does not have a correspondent in new version
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package bar
trait A {
def foo[T](x: T): T = x
def baz[T](x: T): T = x
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package bar
private[bar] trait A {
def baz[T](x: T): T = x
}

0 comments on commit 295754c

Please sign in to comment.