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

use ClassTag instead of Manifest #1265

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

xuwei-k
Copy link
Member

@xuwei-k xuwei-k commented Oct 3, 2023

deprecated since Scala 3.

$ scala -deprecation
Welcome to Scala 3.3.1 (11.0.20, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                      
scala> def array[T: scala.reflect.Manifest](size: Int)(f: => T) = Array.tabulate(size)(_ => f)
def array[T](size: Int)(f: => T)(implicit evidence$1: Manifest[T]): Array[T]
                                                                                                                                      
scala> array[String](1)("a")
1 warning found
-- Deprecation Warning: --------------------------------------------------------
1 |array[String](1)("a")
  |                     ^
  |Compiler synthesis of Manifest and OptManifest is deprecated, instead
  |replace with the type `scala.reflect.ClassTag[String]`.
  |Alternatively, consider using the new metaprogramming features of Scala 3,
  |see https://docs.scala-lang.org/scala3/reference/metaprogramming.html
val res0: Array[String] = Array(a)

@xuwei-k xuwei-k requested a review from eed3si9n October 5, 2023 06:10
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit 3f5e423 into sbt:develop Oct 6, 2023
7 checks passed
@xuwei-k xuwei-k deleted the Manifest-ClassTag branch October 6, 2023 16:35
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

Successfully merging this pull request may close these issues.

2 participants