Skip to content

Commit b023ec8

Browse files
Merge pull request #11164 from dotty-staging/change-signature-of-summon
Make summon parameter an inline parameter
2 parents d8e4af7 + f98100e commit b023ec8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
219219
toTextGlobal(tp.resultType)
220220
}
221221
case AnnotatedType(tpe, annot) =>
222-
toTextLocal(tpe) ~ " " ~ toText(annot)
222+
if annot.symbol == defn.InlineParamAnnot then toText(tpe)
223+
else toTextLocal(tpe) ~ " " ~ toText(annot)
223224
case tp: TypeVar =>
224225
if (tp.isInstantiated)
225226
toTextLocal(tp.instanceOpt) ~ (Str("^") provided printDebug)

library/src/scala/runtime/stdLibPatches/Predef.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object Predef:
3131
* @tparam T the type of the value to be summoned
3232
* @return the given value typed: the provided type parameter
3333
*/
34-
inline def summon[T](using x: T): x.type = x
34+
transparent inline def summon[T](using inline x: T): x.type = x
3535

3636
// Extension methods for working with explicit nulls
3737

0 commit comments

Comments
 (0)