Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 3962b5b

Browse files
committed
Methodからのobject instance取得を関数化
1 parent 6de076c commit 3962b5b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.mapk.fastkfunction
2+
3+
import java.lang.reflect.Method
4+
5+
/**
6+
* Get object instance if receiver declared in object.
7+
*
8+
* @receiver JavaMethod.
9+
* @return Method.declaringClass.kotlin.objectInstance
10+
* @throws UnsupportedOperationException Method declared on top level.
11+
*/
12+
internal val Method.declaringObject: Any? get() = declaringClass.kotlin.objectInstance

0 commit comments

Comments
 (0)