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

typeinfo is error-prone #475

Open
OlegYch opened this issue Jun 16, 2023 · 0 comments
Open

typeinfo is error-prone #475

OlegYch opened this issue Jun 16, 2023 · 0 comments

Comments

@OlegYch
Copy link
Contributor

OlegYch commented Jun 16, 2023

given code like this on "com.softwaremill.magnolia1_3" %% "magnolia" % "1.3.2"

def f[T] = magnolia1.Macro.typeInfo[T]
f[List[Int]]

i get TypeInfo(Playground.f,T,List())
instead this should either not compile or produce TypeInfo(scala.collection.immutable,List,List(TypeInfo(scala,Int,List())))

compare this to TypeTag behaviour on scala2:

type TypeTag[T] = scala.reflect.runtime.universe.TypeTag[T]
def f[T:TypeTag] = implicitly[TypeTag[T]]
f[List[Int]]

correctly returns TypeTag[List[Int]] or doesn't compile if you forget :TypeTag bound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant