-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spurious is not a class type
error when inheriting a class without call parentheses() through a type alias
#18623
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
Comments
I think this is as it should be. I don't really see a strong reason for changing these rules. |
@odersky final abstract class ForcedRecompilationToken[T]
object ForcedRecompilationToken {
implicit def default: ForcedRecompilationToken["abc"] = null
}
object x {
class GoodNoParens[T](implicit ev: ForcedRecompilationToken[T])
}
export x.GoodNoParens as BadNoParens
// error
object A extends BadNoParens
// ok
object B extends BadNoParens()
object C extends x.GoodNoParens
object App extends App {
println("compiled")
} This worked correctly on Scala 2 and is currently blocking me from porting existing library code to Scala 3...[1] |
OK, trying a fix... |
When typing parent types as constructors with implicitly added `()` arguments, also admit alias types that become classes after eta-collapsing. Fixes scala#18623
When typing parent types as constructors with implicitly added `()` arguments, also admit alias types that become classes after eta-collapsing. Fixes scala#18623
When typing parent types as constructors with implicitly added `()` arguments, also admit alias types that become classes after eta-collapsing. Fixes #18623
@odersky Thank you! 🙏 |
* Revert "Disable recompilation trigger functionality on Scala 3 completely due to bug scala/scala3#15976" This reverts commit 2ab8bf4. * use random token again. Waiting on usability fix for scala/scala3#18623 before merge * CI workaround for scala/scala3#19745 * Due to Scala 3 bug scala/scala3#19745 remove `distage.plugins.{PluginDef,BootstrapPluginDef}` aliases on Scala 3
Compiler version
3.3.1
Minimized code
https://scastie.scala-lang.org/1OfTRArhRuKz5Kq59dUcHg
Output
Expectation
Similar situation as in #15976, but this time merely using a type alias to refer to the class breaks the fix for the aforementioned issue and causes a spurious 'not a class type' error.
The text was updated successfully, but these errors were encountered: