-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Spurious CyclicReference error while unpickling #13904
Comments
It turns out that opaque types are not necessary to reproduce this. And with a bit of simplification and reorganization, we can show this is purely a separate compilation (pickling) issue: fileA_1.scala class DiscordRecord[Obj]
trait DiscordRecordCompanion[AbsStructural[A], Supertypes] {
type R = AbsStructural[this.type] & Supertypes
}
type ChannelR[Obj] = DiscordRecord[Obj]
type Channel = Channel.R
object Channel extends DiscordRecordCompanion[ChannelR, Any]
type GuildChannelR[Obj] = ChannelR[Obj] {
val id: SnowflakeType[GuildChannel]
}
type GuildChannel = GuildChannel.R
object GuildChannel extends DiscordRecordCompanion[GuildChannelR, Channel]
type TopLevelGuildChannelR[Obj] = GuildChannelR[Obj]
type TopLevelGuildChannel = TopLevelGuildChannel.R
object TopLevelGuildChannel extends DiscordRecordCompanion[TopLevelGuildChannelR, GuildChannel]
type SnowflakeType[A] = Long fileB_2.scala //def bar: GuildChannel = ??? // problem goes away if this is uncommented
def foo: TopLevelGuildChannel = ???
val ev = summon[GuildChannel <:< Channel]
Since #14884, we get an additional error which may help shed some light:
Interestingly, compiling with Compiling with
Turning on the completion printer we see
Uncommenting the definition of |
Compiler version
3.1.0
This feels very much like #13190, except it has a few more moving parts I haven't been able to remove while minimizing it.
Minimized code
Steps to reproduce
ev2
infileB.scala
ev1
andev2
Output
Expectation
It should compile in both cases, also when using incremental compilation.
The text was updated successfully, but these errors were encountered: