Skip to content

Commit

Permalink
feat: format upper bound of type parameters (#898)
Browse files Browse the repository at this point in the history
### Summary of Changes

Add missing formatting for the upper bound of type parameters.
  • Loading branch information
lars-reimann authored Feb 20, 2024
1 parent 4c577a3 commit 9d6ce28
Show file tree
Hide file tree
Showing 31 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ export class SafeDsFormatter extends AbstractFormatter {
}

formatter.property('variance').append(oneSpace());
formatter.keyword('sub').surround(oneSpace());
formatter.keyword('=').surround(oneSpace());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< in T sub Int = Int >()

// -----------------------------------------------------------------------------

fun myFunction<in T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< in T sub Int >()

// -----------------------------------------------------------------------------

fun myFunction<in T sub Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fun myFunction< @Annotation in T sub Int > ( )

// -----------------------------------------------------------------------------

fun myFunction<
@Annotation
in T sub Int
>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< out T sub Int = Int >()

// -----------------------------------------------------------------------------

fun myFunction<out T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< out T sub Int >()

// -----------------------------------------------------------------------------

fun myFunction<out T sub Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fun myFunction< @Annotation out T sub Int > ( )

// -----------------------------------------------------------------------------

fun myFunction<
@Annotation
out T sub Int
>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< T sub Int = Int >()

// -----------------------------------------------------------------------------

fun myFunction<T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun myFunction< T sub Int >()

// -----------------------------------------------------------------------------

fun myFunction<T sub Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fun myFunction< @Annotation T sub Int >()

// -----------------------------------------------------------------------------

fun myFunction<
@Annotation
T sub Int
>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<in T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<in T sub Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<out T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<out T sub Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<T sub Int = Int>()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// $TEST$ no_syntax_error

fun myFunction<T sub Int>()

0 comments on commit 9d6ce28

Please sign in to comment.