Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat default value getters as accessible. #145

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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 = "") = ()
}