Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations on type projections should be wrapped in same way as other annotations #1917

Closed
paul-dingemans opened this issue Apr 5, 2023 · 0 comments · Fixed by #1920
Closed
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

Given a type argument list in which one or more of the type projects are annotation than the same wrapping rules should be applies as with other annotations.

Exampe:

val fooBar: FooBar<String, @Foo String, @Foo @Bar String, @Bar("bar") @Foo String> = FooBar()

should be formatted as:

val fooBar: FooBar<
    String,
    @Foo String,
    @Foo @Bar
    String,
    @Bar("bar")
    @Foo
    String
    > = FooBar()

In case the type argument list only contains type projections without or with a single annotation without parameter than the annotation does not need to be wrapped. So code below will not be changed:

val foo1: List<@Foo String> = emptyList()
val foo2 = emptyList<@Foo String>()
val foo3: Map<@Foo String, @Foo String> = emptyMap()
val foo4 = emptyMap<@Foo String, @Foo String>()
@paul-dingemans paul-dingemans added this to the 0.49.0 milestone Apr 5, 2023
paul-dingemans added a commit that referenced this issue Apr 6, 2023
…ial`

Closes #1916

Annotations on type projections should be wrapped in same way as other annotations
Close #1917

Fix annotated expression inside function literal

Fix closing angle bracket on type argument list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant