Skip to content

Add quoted.Type.valueOfTuple #12423

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

Merged
merged 1 commit into from
May 18, 2021

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented May 11, 2021

  /** Extracts the value of a tuple of singleton constant types.
   *  Returns Some of the tuple type if it is a tuple singleton constant types.
   *  Returns None if the type is not a tuple singleton constant types.
   *
   *  Example usage:
   *  ```scala
   *  ... match
   *    case '{ $mirrorExpr : Mirror.Sum { type MirroredElemLabels = label } } =>
   *      Type.valueOfTuple[label] // Option[Tuple]
   *  }
   *  ```
   *  @syntax markdown
   */
  @experimental
  def valueOfTuple[T <: Tuple](using Type[T])(using Quotes): Option[T] = ...

@nicolasstucki nicolasstucki force-pushed the add-Type-valueOfTuple branch from c4cf759 to 5967e66 Compare May 11, 2021 15:44
@nicolasstucki
Copy link
Contributor Author

See #12417 (comment)

@nicolasstucki nicolasstucki marked this pull request as ready for review May 12, 2021 07:32
@nicolasstucki
Copy link
Contributor Author

Will need rebase on #12371

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolasstucki nicolasstucki force-pushed the add-Type-valueOfTuple branch from 5967e66 to 7ceb861 Compare May 17, 2021 13:55
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

CI failed, otherwise LGTM

@nicolasstucki nicolasstucki force-pushed the add-Type-valueOfTuple branch from f69568f to d359fc8 Compare May 18, 2021 09:20
@nicolasstucki nicolasstucki enabled auto-merge May 18, 2021 10:34
@nicolasstucki nicolasstucki merged commit 071c720 into scala:master May 18, 2021
@nicolasstucki nicolasstucki deleted the add-Type-valueOfTuple branch May 18, 2021 10:36
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
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.

3 participants