Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
c6a72ba6
Commit
c6a72ba6
authored
Mar 24, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress expected warnings
parent
56843580
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/contentToString.kt
...ommonMain/kotlin/net.mamoe.mirai/utils/contentToString.kt
+15
-3
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/contentToString.kt
View file @
c6a72ba6
...
@@ -129,7 +129,10 @@ fun Any?._miraiContentToString(prefix: String = ""): String = when (this) {
...
@@ -129,7 +129,10 @@ fun Any?._miraiContentToString(prefix: String = ""): String = when (this) {
internal
expect
fun
KProperty1
<*,
*>.
getValueAgainstPermission
(
receiver
:
Any
):
Any
?
internal
expect
fun
KProperty1
<*,
*>.
getValueAgainstPermission
(
receiver
:
Any
):
Any
?
@Suppress
(
"EXTENSION_SHADOWED_BY_MEMBER"
)
private
val
KProperty1
<*,
*>.
isConst
:
Boolean
get
()
=
false
// on JVM, it will be resolved to member function
private
val
KProperty1
<*,
*>.
isConst
:
Boolean
get
()
=
false
// on JVM, it will be resolved to member function
@Suppress
(
"EXTENSION_SHADOWED_BY_MEMBER"
)
private
val
KClass
<*>.
isData
:
Boolean
get
()
=
false
// on JVM, it will be resolved to member function
private
val
KClass
<*>.
isData
:
Boolean
get
()
=
false
// on JVM, it will be resolved to member function
@MiraiDebugAPI
@MiraiDebugAPI
...
@@ -163,14 +166,23 @@ private fun Any.contentToStringReflectively(
...
@@ -163,14 +166,23 @@ private fun Any.contentToStringReflectively(
}
+
"\n$prefix}"
}
+
"\n$prefix}"
}
}
private
val
<
T
:
Any
>
KClass
<
T
>.
supertypes
:
List
<
KType
>
get
()
=
listOf
()
// on JVM, it will be resolved to member function
// on JVM, it will be resolved to member function
@Suppress
(
"EXTENSION_SHADOWED_BY_MEMBER"
)
private
val
<
T
:
Any
>
KClass
<
T
>.
supertypes
:
List
<
KType
>
get
()
=
listOf
()
private
fun
KClass
<
out
Any
>.
thisClassAndSuperclassSequence
():
Sequence
<
KClass
<
out
Any
>>
{
private
fun
KClass
<
out
Any
>.
thisClassAndSuperclassSequence
():
Sequence
<
KClass
<
out
Any
>>
{
return
sequenceOf
(
this
)
+
return
sequenceOf
(
this
)
+
this
.
supertypes
.
asSequence
()
this
.
supertypes
.
asSequence
()
.
mapNotNull
{
type
->
type
.
classifier
?.
takeIf
{
it
is
KClass
<
*
>
}
?.
takeIf
{
it
!=
Any
::
class
} as?
KClass
<
out
Any
>
}.
flatMap
{
it
.
thisClassAndSuperclassSequence
()
}
.
mapNotNull
{
type
->
type
.
classifier
?.
takeIf
{
it
is
KClass
<
*
>
}
?.
takeIf
{
it
!=
Any
::
class
} as?
KClass
<
out
Any
>
}.
flatMap
{
it
.
thisClassAndSuperclassSequence
()
}
}
}
private
val
<
T
:
Any
>
KClass
<
T
>.
members
:
List
<
KProperty
<
*
>>
get
()
=
listOf
()
// on JVM, it will be resolved to member function
// on JVM, it will be resolved to member function
@Suppress
(
"EXTENSION_SHADOWED_BY_MEMBER"
)
private
val
<
T
:
Any
>
KClass
<
T
>.
members
:
List
<
KProperty
<
*
>>
get
()
=
listOf
()
@Suppress
(
"UNCHECKED_CAST"
)
@Suppress
(
"UNCHECKED_CAST"
)
private
fun
Any
.
allMembersFromSuperClassesMatching
(
classFilter
:
(
KClass
<
out
Any
>)
->
Boolean
):
Sequence
<
KProperty1
<
Any
,
*
>>
{
private
fun
Any
.
allMembersFromSuperClassesMatching
(
classFilter
:
(
KClass
<
out
Any
>)
->
Boolean
):
Sequence
<
KProperty1
<
Any
,
*
>>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment