# Feature request: add Template Specialization for Inline reified type argument

**URL:** https://discuss.kotlinlang.org/t/feature-request-add-template-specialization-for-inline-reified-type-argument/13850
**Category:** Language Design
**Created:** [August 13, 2019, 10:44am UTC](https://discuss.kotlinlang.org/t/feature-request-add-template-specialization-for-inline-reified-type-argument/13850 "2019-08-13T10:44:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cpdyj](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@cpdyj](https://discuss.kotlinlang.org/u/cpdyj)
#### Post date: [August 13, 2019, 10:44am UTC](https://discuss.kotlinlang.org/t/feature-request-add-template-specialization-for-inline-reified-type-argument/13850/1 "2019-08-13T10:44:38Z")

</div>

for this function:

```auto
inline <reified T> fun foo(arg: T): T = TODO()

// T is Int absoutly.
inline <reified T : Int> fun foo(arg: T): T = arg + 1

// I am confuse that: Should the return value type be changed?
inline <reified T : Either<L, R>> fun foo(arg: T): L? = 
    if (arg.isLeft) (arg as Left).a else null

```
