File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -446,16 +446,15 @@ object SymDenotations {
446446
447447 /** The name given in an `@alpha` annotation if one is present, `name` otherwise */
448448 final def erasedName (implicit ctx : Context ): Name =
449- if (isTerm)
450- getAnnotation(defn.AlphaAnnot ) match {
451- case Some (ann) =>
452- ann.arguments match {
453- case Literal (Constant (str : String )) :: Nil => str.toTermName
454- case _ => name
455- }
456- case _ => name
457- }
458- else name
449+ getAnnotation(defn.AlphaAnnot ) match {
450+ case Some (ann) =>
451+ ann.arguments match {
452+ case Literal (Constant (str : String )) :: Nil =>
453+ if (isType) str.toTypeName else str.toTermName
454+ case _ => name
455+ }
456+ case _ => name
457+ }
459458
460459 // ----- Tests -------------------------------------------------
461460
Original file line number Diff line number Diff line change 44public class Test_2 {
55
66 public static void main (String [] args ) {
7- Alpha <String > a = new Beta ();
7+ Alpha <String > a = new Bar ();
88 assert a .foo () == 1 ;
99 assert a .bar ("a" ).equals ("aa" );
1010 Alpha <String > aa = a .append (a );
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ abstract class Alpha[T] {
1111
1212}
1313
14- class Beta extends Alpha [String ] {
14+ @ alpha( " Bar " ) class | extends Alpha [String ] {
1515
1616 @ alpha(" bar" ) override def foo (x : String ) = x ++ x
1717
You can’t perform that action at this time.
0 commit comments