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

spurious "cyclic aliasing" error (2) #10669

Closed
sir-wabbit opened this issue Dec 24, 2017 · 0 comments · Fixed by scala/scala#10626
Closed

spurious "cyclic aliasing" error (2) #10669

sir-wabbit opened this issue Dec 24, 2017 · 0 comments · Fixed by scala/scala#10626
Assignees
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) should compile typer
Milestone

Comments

@sir-wabbit
Copy link

sir-wabbit commented Dec 24, 2017

abstract class CharSet[P] {
  type Type <: P
}

object LetterOrDigit extends CharSet[Char]
object Digit extends CharSet[LetterOrDigit.Type]

type D = Digit.Type // error: cyclic aliasing or subtyping involving type Type

Possibly related to #8252


Without parent trait:

object LetterOrDigit {
  type Type <: Char
}
object Digit {
  type Type <: LetterOrDigit.Type
}
type D = Digit.Type // works fine

Another workaround:

trait CharSet[P] {
  type Type <: P
}
object LetterOrDigit extends { type Type <: Char } with CharSet[Char]
object Digit extends { type Type <: LetterOrDigit.Type } with CharSet[LetterOrDigit.Type]
type D = Digit.Type // works fine
@sir-wabbit sir-wabbit changed the title spurious "cyclic aliasing" error spurious "cyclic aliasing" error (2) Dec 24, 2017
@SethTisue SethTisue added fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) typer labels Aug 10, 2023
@SethTisue SethTisue added this to the Backlog milestone Aug 10, 2023
@lrytz lrytz modified the milestones: Backlog, 2.13.13 Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) should compile typer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants