Skip to content

Instantly share code, notes, and snippets.

@Morfly
Last active August 12, 2021 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Morfly/c5a0a785de8e06ea402cc07aca9cb687 to your computer and use it in GitHub Desktop.
Save Morfly/c5a0a785de8e06ea402cc07aca9cb687 to your computer and use it in GitHub Desktop.
override fun visitTypeArgument(typeArgument: KSTypeArgument, data: Unit) {
when (val variance: Variance = typeArgument.variance) {
STAR -> {
file += "*"
return
}
COVARIANT, CONTRAVARIANT -> {
file += variance.label // 'out' or 'in'
file += " "
}
INVARIANT -> {
// do nothing
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment