# Annotation typealias

**URL:** <https://discuss.kotlinlang.org/t/annotation-typealias/17784>\
**Category:** Language Design\
**Created:** [May 21, 2020, 11:35pm UTC](https://discuss.kotlinlang.org/t/annotation-typealias/17784 "2020-05-21T23:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tradeJmark](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tradeJmark](https://discuss.kotlinlang.org/u/tradeJmark)\
**Post date:** [May 21, 2020, 11:35pm UTC](https://discuss.kotlinlang.org/t/annotation-typealias/17784/1 "2020-05-21T23:35:15Z")

</div>

Arguments to annotations have to be compile-time constants, so it seems to me some syntax like this could exist:

```
typealias MySpecificAnnotation = SomeAnnotation("argument")

```

Now, it’s possible something like this already exists that I missed, and it’s also possible I’ve neglected to consider some reasons why something like this would be inadviseable, but I was curious if it was considered.

---

<div class="post-metadata">

**Author:** ![derektom14](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/derektom14/32/7411_2.png) [@derektom14](https://discuss.kotlinlang.org/u/derektom14)\
**Post date:** [May 22, 2020, 7:22am UTC](https://discuss.kotlinlang.org/t/annotation-typealias/17784/2 "2020-05-22T07:22:47Z")

</div>

I’d also like to see something like `typealias MyAnnotation(x: String) = OtherAnnotation(x, CONSTANT)` or even `typealias MyAnnotation = OtherAnnotation() + AnotherAnnotation()` (adding two annotations with a single annotation, I’ve seen classes where every field has three annotations for various serialization frameworks, and they all take the same argument).

---

<div class="post-metadata">

**Author:** ![clovisai](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@clovisai](https://discuss.kotlinlang.org/u/clovisai)\
**Post date:** [May 25, 2020, 12:27pm UTC](https://discuss.kotlinlang.org/t/annotation-typealias/17784/3 "2020-05-25T12:27:48Z")

</div>

Yes please, the ability to create a custom `@PublicApi` annotation that suppresses unused warnings, and does a few other things would be incredibly useful for library authors
