Skip to content

Commit

Permalink
Merge pull request #145 from szeiger/issue/136
Browse files Browse the repository at this point in the history
Treat default value getters as accessible.
  • Loading branch information
adriaanm committed Nov 29, 2016
2 parents f9cd0c1 + 02e9598 commit e083f6d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class MemberInfo(val owner: ClassInfo, val bytecodeName: String, override val fl
decodedName.substring(0, i+1).endsWith("$extension")
}

def isAccessible: Boolean = isPublic && !isSynthetic && (!hasSyntheticName || isExtensionMethod)
def isDefaultGetter: Boolean = decodedName.contains("$default$")

def isAccessible: Boolean = isPublic && !isSynthetic && (!hasSyntheticName || isExtensionMethod || isDefaultGetter)

def nonAccessible: Boolean = !isAccessible

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
synthetic method copy$default$2()java.lang.String in class A has a different result type in new version, where it is Int rather than java.lang.String
synthetic method copy$default$1()Int in class A has a different result type in new version, where it is Boolean rather than Int
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
final class A {
def copy(x: Int = 0, y: String = "") = ()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
final class A {
def copy(x: Int, y: String) = ()
def copy(z: Boolean = true, x: Int = 0, y: String = "") = ()
}

0 comments on commit e083f6d

Please sign in to comment.