Skip to content

chore: add transparent modifier to already assumed transparent types #23104

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

Draft
wants to merge 1 commit into
base: embed-stdlib
Choose a base branch
from

Conversation

hamzaremmal
Copy link
Member

dotc already assumes that some of the types in stdlib are transparent. We now drop the assumption and add the transparent modifier to the source.

For reference, the list of assumed transparent types:

@tu lazy val assumedTransparentNames: Map[Name, Set[Symbol]] =
// add these for now, until we had a chance to retrofit 2.13 stdlib
// we should do a more through sweep through it then.
val strs = Map(
"Any" -> Set("scala"),
"AnyVal" -> Set("scala"),
"Matchable" -> Set("scala"),
"Product" -> Set("scala"),
"Object" -> Set("java.lang"),
"Comparable" -> Set("java.lang"),
"Serializable" -> Set("java.io"),
"BitSetOps" -> Set("scala.collection"),
"IndexedSeqOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"IterableOnceOps" -> Set("scala.collection"),
"IterableOps" -> Set("scala.collection"),
"LinearSeqOps" -> Set("scala.collection", "scala.collection.immutable"),
"MapOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"SeqOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"SetOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"SortedMapOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"SortedOps" -> Set("scala.collection"),
"SortedSetOps" -> Set("scala.collection", "scala.collection.mutable", "scala.collection.immutable"),
"StrictOptimizedIterableOps" -> Set("scala.collection"),
"StrictOptimizedLinearSeqOps" -> Set("scala.collection"),
"StrictOptimizedMapOps" -> Set("scala.collection", "scala.collection.immutable"),
"StrictOptimizedSeqOps" -> Set("scala.collection", "scala.collection.immutable"),
"StrictOptimizedSetOps" -> Set("scala.collection", "scala.collection.immutable"),
"StrictOptimizedSortedMapOps" -> Set("scala.collection", "scala.collection.immutable"),
"StrictOptimizedSortedSetOps" -> Set("scala.collection", "scala.collection.immutable"),
"ArrayDequeOps" -> Set("scala.collection.mutable"),
"DefaultSerializable" -> Set("scala.collection.generic"),
"IsIterable" -> Set("scala.collection.generic"),
"IsIterableLowPriority" -> Set("scala.collection.generic"),
"IsIterableOnce" -> Set("scala.collection.generic"),
"IsIterableOnceLowPriority" -> Set("scala.collection.generic"),
"IsMap" -> Set("scala.collection.generic"),
"IsSeq" -> Set("scala.collection.generic"))
strs.map { case (simple, pkgs) => (
simple.toTypeName,
pkgs.map(pkg => staticRef(pkg.toTermName, isPackage = true).symbol.moduleClass)
)
}

@hamzaremmal hamzaremmal added this to the 3.8.0 milestone May 5, 2025
@hamzaremmal hamzaremmal requested review from sjrd and natsukagami May 5, 2025 17:03
@hamzaremmal hamzaremmal self-assigned this May 5, 2025
@hamzaremmal hamzaremmal changed the title chore: add transparent modifer to already assumed transparent types chore: add transparent modifier to already assumed transparent types May 5, 2025
Copy link
Contributor

@natsukagami natsukagami left a comment

Choose a reason for hiding this comment

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

Checked to have all removed instances in #23105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants