Skip to content

Commit 8390432

Browse files
Merge pull request #4691 from dotty-staging/do-not-print-inline-annot
Do not print @inline as keyword `inline` is already printed
2 parents 84ca54c + bea6c47 commit 8390432

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
922922
case Annotation(annot, _) =>
923923
annot.tpe match {
924924
case Type.TypeRef(_, Type.SymRef(PackageDef("internal", _), Type.ThisType(Type.SymRef(PackageDef("annotation", _), NoPrefix())))) => false
925+
case Type.TypeRef("inline", Types.ScalaPackage()) => false
925926
case _ => true
926927
}
927928
case x => throw new MatchError(x.show)

tests/pos/simpleInline.decompiled

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** Decompiled from out/posTestFromTasty/pos/simpleInline/Foo.class */
2+
class Foo() {
3+
inline def foo: scala.Int = 9
4+
def bar: scala.Int = { // inlined
5+
9
6+
}
7+
}

tests/pos/simpleInline.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
class Foo {
3+
@inline def foo: Int = 9
4+
def bar: Int = foo
5+
}

0 commit comments

Comments
 (0)