@@ -254,24 +254,25 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
254
254
def apiClassStructure (csym : ClassSymbol ): api.Structure = {
255
255
val cinfo = csym.classInfo
256
256
257
- val bases =
258
- try {
259
- val ancestorTypes0 = linearizedAncestorTypes(cinfo)
260
- if (ValueClasses .isDerivedValueClass(csym)) {
261
- val underlying = ValueClasses .valueClassUnbox(csym).info.finalResultType
262
- // The underlying type of a value class should be part of the name hash
263
- // of the value class (see the test `value-class-underlying`), this is accomplished
264
- // by adding the underlying type to the list of parent types.
265
- underlying :: ancestorTypes0
266
- } else
267
- ancestorTypes0
268
- } catch {
269
- case ex : CyclicReference =>
270
- // See neg/i1750a for an example where a cyclic error can arise.
271
- // The root cause in this example is an illegal "override" of an inner trait
272
- ctx.error(cyclicErrorMsg(ex), csym.pos)
273
- defn.ObjectType :: Nil
274
- }
257
+ val bases = {
258
+ val ancestorTypes0 =
259
+ try linearizedAncestorTypes(cinfo)
260
+ catch {
261
+ case ex : CyclicReference =>
262
+ // See neg/i1750a for an example where a cyclic error can arise.
263
+ // The root cause in this example is an illegal "override" of an inner trait
264
+ ctx.error(cyclicErrorMsg(ex), csym.pos)
265
+ defn.ObjectType :: Nil
266
+ }
267
+ if (ValueClasses .isDerivedValueClass(csym)) {
268
+ val underlying = ValueClasses .valueClassUnbox(csym).info.finalResultType
269
+ // The underlying type of a value class should be part of the name hash
270
+ // of the value class (see the test `value-class-underlying`), this is accomplished
271
+ // by adding the underlying type to the list of parent types.
272
+ underlying :: ancestorTypes0
273
+ } else
274
+ ancestorTypes0
275
+ }
275
276
276
277
val apiBases = bases.map(apiType)
277
278
0 commit comments