question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

declaration-site variance annotations of generic type arguments

See original GitHub issue

Declaration-site variance annotations in other languages

C#, Kotlin, Ceylon:

  • out covariance
  • in contravariance

Scala, OCaml, Flow:

  • + covariance
  • - contravariance

What should we choose? (see discussion about generic types in #55 and #80)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
Mouvediacommented, Apr 14, 2016

Ill give you a template for your straw-man proposal because for pure javascript developers it’s really hard to grasp.

  1. signature with + and -
  2. signature with in and out (Microsoft/TypeScript#1394)
  3. usage example (desired outcome)
  4. PROS of bivariant
Read more comments on GitHub >

github_iconTop Results From Across the Web

Declaration-Site Variance - Dave Leeds on Kotlin
Declaration-site variance is kind of like a generic that takes a vow. For each type parameter, there are two kinds of vows that...
Read more >
Kotlin Generics : declaration-site variance and type projections
In a nutshell, generics enable types (classes and interfaces) to be parameters when defining classes, interfaces, and methods. Much like the ...
Read more >
Declaration-site and use-site variance explained
This annotation style is called declaration-site variance, because the type parameter is annotated where the generic type is declared.
Read more >
Kotlin Generics declaration-site variance <in T> construction
Moreover, the declaration-site variance out E means that E never appears in an in -position (there's no function parameter of type E and...
Read more >
Chapter 9. Generics - Kotlin in Action - liveBook · Manning
Declaring generic functions and classes; Type erasure and reified type parameters; Declaration-site and use-site variance;
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found