Skip to content

Commit 8fbea04

Browse files
authored
Merge pull request #11471 from dotty-staging/fix-10567
Fix #10567: avoid forcing symbols in classfile parser
2 parents 735c4a5 + 050f430 commit 8fbea04

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class ClassfileParser(
385385
if (argsBuf != null) argsBuf += arg
386386
}
387387
accept('>')
388-
if (skiptvs) tp else tp.appliedTo(argsBuf.toList)
388+
if (skiptvs) tp else AppliedType(tp, argsBuf.toList)
389389
}
390390
else tp
391391
case tp =>

tests/pos/i10567/Main_2.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test {
2+
val bldr = SchemaBuilder_1.builder()
3+
val oops = bldr.fixed("foo")
4+
}

tests/pos/i10567/SchemaBuilder_1.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class SchemaBuilder_1 {
2+
public static class Schema {}
3+
4+
public static TypeBuilder<Schema> builder() {
5+
throw new UnsupportedOperationException();
6+
}
7+
8+
public static class NamespacedBuilder<R, S extends NamespacedBuilder<R, S>> {}
9+
10+
public static class FixedBuilder<R> extends NamespacedBuilder<R, FixedBuilder<R>> {}
11+
12+
public static class TypeBuilder<R> {
13+
public FixedBuilder<R> fixed(String name) {
14+
throw new UnsupportedOperationException();
15+
}
16+
}
17+
}

tests/pos/i10945/Built_1.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public interface Built_1 {
2+
interface Builder<A> extends GeneralBuilder<Built_1, Builder<A>> {}
3+
}
4+
5+
interface GeneralBuilder<R, B extends GeneralBuilder<R, B>> {}

tests/pos/i10945/Test_2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def useBuilder[A](builder: Built_1.Builder[A]): Unit = ???

0 commit comments

Comments
 (0)