Skip to content

Commit c97c90b

Browse files
Merge pull request #8515 from dotty-staging/ignore-bridges
Do not create symbols for classfile artifacts
2 parents 713ac6e + 32f9deb commit c97c90b

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ object Flags {
567567
val TermParamOrAccessor: FlagSet = Param | ParamAccessor
568568
val PrivateParamAccessor: FlagSet = ParamAccessor | Private
569569
val PrivateOrSynthetic: FlagSet = Private | Synthetic
570+
val PrivateOrArtifact: FlagSet = Private | Artifact
570571
val ClassTypeParam: FlagSet = Private | TypeParam
571572
val Scala2Trait: FlagSet = Scala2x | Trait
572573
val SyntheticArtifact: FlagSet = Synthetic | Artifact

compiler/src/dotty/tools/dotc/core/classfile/ClassfileConstants.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ object ClassfileConstants {
341341
case JAVA_ACC_PRIVATE => Private
342342
case JAVA_ACC_PROTECTED => Protected
343343
case JAVA_ACC_FINAL => Final
344-
case JAVA_ACC_SYNTHETIC => Synthetic
344+
case JAVA_ACC_SYNTHETIC => SyntheticArtifact
345345
case JAVA_ACC_STATIC => JavaStatic
346346
case JAVA_ACC_ENUM => Enum
347347
case JAVA_ACC_ABSTRACT => if (isClass) Abstract else Deferred

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class ClassfileParser(
226226
if (method) Flags.Method | methodTranslation.flags(jflags)
227227
else fieldTranslation.flags(jflags)
228228
val name = pool.getName(in.nextChar)
229-
if (!sflags.is(Flags.Private) || name == nme.CONSTRUCTOR) {
229+
if (!sflags.isOneOf(Flags.PrivateOrArtifact) || name == nme.CONSTRUCTOR) {
230230
val member = ctx.newSymbol(
231231
getOwner(jflags), name, sflags, memberCompleter,
232232
getPrivateWithin(jflags), coord = start)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public abstract class A_1 {
2+
public abstract Object f();
3+
4+
public static abstract class B extends A_1 {
5+
@Override
6+
public abstract String f();
7+
}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class C extends A_1.B {
2+
def f() = ""
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class BuilderBase<A> {
2+
public scala.Option<A> build() { return null; }
3+
}
4+
public class Builder_1<A> extends BuilderBase<A> { }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test {
2+
val builder: Builder_1[Int] = ???
3+
builder.build(): Option[Int]
4+
}

0 commit comments

Comments
 (0)