Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Variance annotations printing

def printTypeParams is modified. Tests are updated.
  • Loading branch information...
commit 64c9122aa35895e6455b7b6a156a9726a6411f22 1 parent b2bf66a
@VladimirNik VladimirNik authored
View
5 src/reflect/scala/reflect/internal/Printers.scala
@@ -107,6 +107,11 @@ trait Printers extends api.Printers { self: SymbolTable =>
if (!ts.isEmpty) {
print("["); printSeq(ts){ t =>
printAnnotations(t)
+ if (t.mods.hasFlag(CONTRAVARIANT)) {
+ print("-")
+ } else if (t.mods.hasFlag(COVARIANT)) {
+ print("+")
+ }
printParam(t)
}{print(", ")}; print("]")
}
View
4 test/files/run/reify_ann3.check
@@ -1,5 +1,5 @@
{
- class Tree[A, B] extends AnyRef {
+ class Tree[A, +B] extends AnyRef {
@new inline @getter() final <paramaccessor> val key: A = _;
def <init>(key: A) = {
super.<init>();
@@ -9,7 +9,7 @@
()
}
{
- class Tree[A, B] extends AnyRef {
+ class Tree[A, +B] extends AnyRef {
final <paramaccessor> private[this] val key: A = _;
@inline @scala.annotation.meta.getter final <stable> <accessor> <paramaccessor> def key: A = Tree.this.key;
def <init>(key: A): Tree[A,B] = {
Please sign in to comment.
Something went wrong with that request. Please try again.