Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/core/NameKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ object NameKinds {
def infoString: String
}

/** The kind of SimpleNames */
val SimpleNameKind = new NameKind(UTF8) { self =>
object SimpleNameKind extends NameKind(UTF8) { self =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think ultimately, we should just make the name registration thread-safe, it doesn't cost much and it's much easier to reason about than remembering which NameKinds have side-effects, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But this is another issue. The problem was not threading but the fact that the registration was not performed at all, since objects are lazy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I see, indeed that's different. If we had enums we could iterate over the namekinds to register them maybe :).

type ThisInfo = Info
val info = new Info
def mkString(underlying: TermName, info: ThisInfo) = unsupported("mkString")
Expand Down Expand Up @@ -359,7 +358,7 @@ object NameKinds {
val ModuleClassName = new SuffixNameKind(OBJECTCLASS, "$", optInfoString = "ModuleClass")

/** A name together with a signature. Used in Tasty trees. */
val SignedName = new NameKind(63) {
object SignedName extends NameKind(63) {

case class SignedInfo(sig: Signature) extends Info {
override def toString = s"$infoString $sig"
Expand Down