Permalink
Browse files

Variance annotations printing

def printTypeParams is modified. Tests are updated.
  • Loading branch information...
VladimirNik committed Dec 31, 2013
1 parent b2bf66a commit 64c9122aa35895e6455b7b6a156a9726a6411f22
Showing with 7 additions and 2 deletions.
  1. +5 −0 src/reflect/scala/reflect/internal/Printers.scala
  2. +2 −2 test/files/run/reify_ann3.check
@@ -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("]")
}
@@ -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] = {

0 comments on commit 64c9122

Please sign in to comment.