Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Jan 4, 2022
1 parent 3428cd3 commit 5eca9cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ internal class ConstructorValueCreator<T>(override val callable: KFunction<T>) :
override val accessible: Boolean = callable.isAccessible

init {
// To prevent the call from failing, save the initial value and then rewrite the flag.
if (!accessible) callable.isAccessible = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class MethodValueCreator<T> private constructor(
// abort, we have some unknown case here
if (!possibleCompanion.isCompanion) return null

// To prevent the call from failing, save the initial value and then rewrite the flag.
val initialCallableAccessible = callable.isAccessible
if (!initialCallableAccessible) callable.isAccessible = true

Expand Down

0 comments on commit 5eca9cd

Please sign in to comment.