-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: generic class resolution errors while using the @Autowired annot…
…ation
- Loading branch information
1 parent
411eee1
commit 3ba1460
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/src/main/java/cn/jailedbird/arouter/ksp/AbstactGenericAcitivty.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cn.jailedbird.arouter.ksp | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import com.alibaba.android.arouter.facade.annotation.Autowired | ||
import com.alibaba.android.arouter.facade.annotation.Route | ||
|
||
interface TestInterface1 | ||
interface TestInterface2 | ||
|
||
abstract class AbstactGenericAcitivty1<T : TestInterface1> : AppCompatActivity() { | ||
@Autowired | ||
var list = mutableListOf<String>() | ||
} | ||
|
||
abstract class AbstactGenericAcitivty2<T : TestInterface1, G:TestInterface2> : AppCompatActivity() { | ||
@Autowired | ||
var list = mutableListOf<String>() | ||
} | ||
|
||
@Route(path = "/app/TestAbstactGenericAcitivty1") | ||
class TestAbstactGenericAcitivty1 : AbstactGenericAcitivty1<TestInterface1>(){ | ||
@Autowired | ||
var t = mutableListOf<String>() | ||
} | ||
|
||
@Route(path = "/app/TestAbstactGenericAcitivty2") | ||
class TestAbstactGenericAcitivty2 : AbstactGenericAcitivty2<TestInterface1, TestInterface2>(){ | ||
@Autowired | ||
var t = mutableListOf<String>() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters