---
title: Enforce comment placement in type argument
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Static Code Analysis (SAST) > SAST
  Rules > Enforce comment placement in type argument
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Enforce comment placement in type argument

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**ID:** `kotlin-code-style/type-argument-comment`

**Language:** Kotlin

**Severity:** Notice

**Category:** Code Style

## Description{% #description %}

In type arguments, comments should be placed on a separate line, before the type argument they document.

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```kotlin
fun Foo<out /* some comment */ Any>.foo() {}
fun Foo<
    Any, // some comment
    Other
    >.foo() {}
```

## Compliant Code Examples{% #compliant-code-examples %}

```kotlin
fun Foo<
    /* some comment */ 
    out Any
    >.foo() {}
fun Foo<
    // some comment 
    out Any
    >.foo() {}
```
  Seamless integrations. Try Datadog Code SecurityDatadog Code Security 
{% icon name="icon-external-link" /%}
 