Skip to content

Expr printer does not show TypeBounds #21832

Open
@jchyb

Description

@jchyb

issue referenced by #20347 (comment)

Compiler version

any

Minimized code

(code taken from tests/pos-macros/quote-sym-newboundedtype https://github.com/scala/scala3/blob/f7f51edb424b281f751a9a47ea2397d5cf5b0343/tests/pos-macros/quote-sym-newboundedtype/Macro_1.scala)

import scala.quoted._
inline def testMacro = ${ testImpl }

def testImpl(using Quotes): Expr[Unit] =
  import quotes.reflect.*
  val sym = Symbol.newBoundedType(Symbol.spliceOwner, "tpe", Flags.EmptyFlags, TypeBounds.lower(TypeRepr.of[String]), Symbol.noSymbol)
  val typeDef = TypeDef(sym)
  println(typeDef.show)
  '{()}
def main() =
    testMacro

Output

type tpe

Expectation

type tpe <: String

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions