Skip to content

Commit

Permalink
Remove hackIsTupleType
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Aug 26, 2021
1 parent cff28af commit f70ae54
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ trait InkuireSupport:
params = typeList.init.map(p => Inkuire.Contravariance(inner(p, vars))) :+ Inkuire.Covariance(inner(typeList.last, vars)),
itid = Some(Inkuire.ITID(s"${name}scala.${name}//[]", isParsed = false))
)
else if t.isTupleType then
else if t.isTupleN then
val name = s"Tuple${typeList.size}"
Inkuire.Type(
name = Inkuire.TypeName(name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ import scala.quoted._
object SyntheticsSupport:

extension (using Quotes)(t: reflect.TypeRepr)
def isTupleType: Boolean = t.hackIsTupleType(t)

def isCompiletimeAppliedType: Boolean = t.hackIsCompiletimeAppliedType(t)

private def hackIsTupleType(rtpe: reflect.TypeRepr): Boolean =
import dotty.tools.dotc
given ctx: dotc.core.Contexts.Context = quotes.asInstanceOf[scala.quoted.runtime.impl.QuotesImpl].ctx
val tpe = rtpe.asInstanceOf[dotc.core.Types.Type]
ctx.definitions.isTupleNType(tpe)

private def hackIsCompiletimeAppliedType(rtpe: reflect.TypeRepr): Boolean =
import dotty.tools.dotc
given ctx: dotc.core.Contexts.Context = quotes.asInstanceOf[scala.quoted.runtime.impl.QuotesImpl].ctx
Expand Down
2 changes: 1 addition & 1 deletion scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ trait TypesSupport:
partOfSignature ++ texts(" => ") ++ inner(rtpe)
case args =>
texts("(") ++ commas(args.init.map(inner)) ++ texts(") => ") ++ inner(args.last)
else if t.isTupleType then
else if t.isTupleN then
typeList match
case Nil =>
Nil
Expand Down

0 comments on commit f70ae54

Please sign in to comment.