Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expr printer does not show TypeBounds #21832

Open
jchyb opened this issue Oct 23, 2024 · 0 comments
Open

Expr printer does not show TypeBounds #21832

jchyb opened this issue Oct 23, 2024 · 0 comments
Labels
area:metaprogramming:reflection Issues related to the quotes reflection API itype:bug

Comments

@jchyb
Copy link
Contributor

jchyb commented Oct 23, 2024

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
@jchyb jchyb added itype:bug area:metaprogramming:reflection Issues related to the quotes reflection API labels Oct 23, 2024
@jchyb jchyb changed the title Express printer does not show TypeBounds Expr printer does not show TypeBounds Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metaprogramming:reflection Issues related to the quotes reflection API itype:bug
Projects
None yet
Development

No branches or pull requests

1 participant