Skip to content

Commit 2e25695

Browse files
committed
Reorder and Rename methods for consistency
1 parent a3dec67 commit 2e25695

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ trait ClassLikeSupport:
130130
case dd: DefDef if isDocumentableExtension(dd.symbol) =>
131131
dd.symbol.extendedSymbol.map { extSym =>
132132
val memberInfo = unwrapMemberInfo(c, dd.symbol)
133-
val typeParams = dd.symbol.extendedTypeParams.map(mkTypeArgument(_, memberInfo.genericTypes))
133+
val typeParams = dd.symbol.extendedTypeParams.params.map(mkTypeArgument(_, memberInfo.genericTypes))
134+
//println(dd.name)
135+
//println("MemberInfo:\n" + memberInfo.paramLists)
136+
//println("extended...:\n" + dd.symbol.extendedTermParamLists)
134137
val termParams = dd.symbol.extendedTermParamLists.zipWithIndex.flatMap { case (paramList, index) =>
135138
memberInfo.paramLists(index) match
136139
case EvidenceOnlyParameterList => Nil
@@ -328,7 +331,7 @@ trait ClassLikeSupport:
328331
): Member =
329332
val method = methodSymbol.tree.asInstanceOf[DefDef]
330333
val paramLists: List[TermParamClause] = methodSymbol.nonExtensionTermParamLists
331-
val genericTypes: List[TypeDef] = if (methodSymbol.isClassConstructor) Nil else methodSymbol.nonExtensionLeadingTypeParams
334+
val genericTypes: List[TypeDef] = if (methodSymbol.isClassConstructor) Nil else methodSymbol.nonExtensionTypeParams.params
332335

333336
val memberInfo = unwrapMemberInfo(c, methodSymbol)
334337

scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,24 @@ object SymOps:
202202

203203
def extendedParamLists: List[reflect.ParamClause] =
204204
sym.splitExtensionParamLists._1
205-
206-
def extendedTypeParams: List[reflect.TypeDef] =
207-
val typeParamss: List[reflect.TypeParamClause] = sym.extendedParamLists.collect{case types: reflect.TypeParamClause => types}
208-
typeParamss.headOption.getOrElse(reflect.TypeParamClause(List())) // only one type param clause on LHS
209-
210-
211205

212206
def extendedTermParamLists: List[reflect.TermParamClause] =
213207
sym.extendedParamLists.collect{case terms: reflect.TermParamClause => terms}
214208

215-
def nonExtensionTermParamLists: List[reflect.TermParamClause] =
216-
sym.nonExtensionParamLists.collect{case terms: reflect.TermParamClause => terms}
209+
def extendedTypeParams: reflect.TypeParamClause =
210+
val typeParamss: List[reflect.TypeParamClause] = sym.extendedParamLists.collect{case types: reflect.TypeParamClause => types}
211+
typeParamss.headOption.getOrElse(reflect.TypeParamClause(List())) // only one type param clause on LHS
217212

218213
def nonExtensionParamLists: List[reflect.ParamClause] =
219214
sym.splitExtensionParamLists._2
220215

221-
222-
def nonExtensionLeadingTypeParams: List[reflect.TypeDef] =
216+
def nonExtensionTypeParams: reflect.TypeParamClause =
223217
val typeParamss: List[reflect.TypeParamClause] = sym.nonExtensionParamLists.collect{case types: reflect.TypeParamClause => types}
224218
typeParamss.headOption.getOrElse(reflect.TypeParamClause(List())) // only one type param clause on RHS
225219

220+
def nonExtensionTermParamLists: List[reflect.TermParamClause] =
221+
sym.nonExtensionParamLists.collect{case terms: reflect.TermParamClause => terms}
222+
226223

227224
end extension
228225

0 commit comments

Comments
 (0)