Skip to content

Commit 8f50644

Browse files
committed
ExtractAPI: handle super prefixes in types
After the previous commit which turned some warnings into errors, some tests like tests/pos/tasty-tags-obscure.scala started failing which revealed the problem. We need to use a custom marker to handle them because it turns out that zinc upstream doesn't handle them either even though they're a part of Scala 2 too!
1 parent 2120cde commit 8f50644

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
173173
private val orMarker = marker("Or")
174174
private val byNameMarker = marker("ByName")
175175
private val matchMarker = marker("Match")
176+
private val superMarker = marker("Super")
176177

177178
/** Extract the API representation of a source file */
178179
def apiSource(tree: Tree): Seq[api.ClassLike] = {
@@ -515,6 +516,9 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
515516
apiType(tp.ref)
516517
case tp: TypeVar =>
517518
apiType(tp.underlying)
519+
case SuperType(thistpe, supertpe) =>
520+
val s = combineApiTypes(apiType(thistpe), apiType(supertpe))
521+
withMarker(s, superMarker)
518522
case _ => {
519523
internalError(i"Unhandled type $tp of class ${tp.getClass}")
520524
Constants.emptyType

0 commit comments

Comments
 (0)