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

Skip splice level checking for <refinement> symbols #22782

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Mar 12, 2025

This is safe to skip because symbols can only be a part of type refinement self referencing prefix, where it is impossible to splice anything.

For some context, this is how the test case looks in typer:

{
  final class $anon() extends AnyRef() {
    type T = Unit
    def make: T = ()
    def take(t: T): Unit = ()
  }
  new $anon():
    {z1 => Object{type T; def make: z1.T; def take(t: z1.T): Unit}}
}:
  Object
    {
      type T >: Nothing <: Any
      def make: <refinement>.this.T
      def take(t: <refinement>.this.T): Unit
    }

The compiler sometimes instead of creating a recursive type directly ({z1 => ...}), creates symbols which reference an enclosing refinement, replacing those with recursive types later.
Fixes #22648

This is safe to skip because <refinement> symbols can only be a part of
type refinement (where they reference that type), where it is impossible
to splice anything.
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.

Wrong staging level for quoted structural/refinement type with type member
2 participants