Skip to content

Commit e93f3d3

Browse files
nbalasundarasarahhaggarty
authored andcommitted
Update generics.md
One can pass an array of String as well, when the function parameter is declared as <in String>
1 parent 5cc55c8 commit e93f3d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/topics/generics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ You can project a type with `in` as well:
239239
fun fill(dest: Array<in String>, value: String) { ... }
240240
```
241241

242-
`Array<in String>` corresponds to Java's `Array<? super String>`. This means that you can pass an array of `CharSequence`
243-
or an array of `Object` to the `fill()` function.
242+
`Array<in String>` corresponds to Java's `Array<? super String>`. This means that you can pass an array of `String`, `CharSequence`,
243+
or `Object` to the `fill()` function.
244244

245245
### Star-projections
246246

0 commit comments

Comments
 (0)