@@ -13,7 +13,7 @@ import typer.ImportInfo.RootRef
13
13
import Comments .CommentsContext
14
14
import Comments .Comment
15
15
import util .Spans .NoSpan
16
- import Symbols . requiredModuleRef
16
+ import Denotations . staticRef
17
17
18
18
import scala .annotation .tailrec
19
19
@@ -1761,23 +1761,53 @@ class Definitions {
1761
1761
def isInfix (sym : Symbol )(using Context ): Boolean =
1762
1762
(sym eq Object_eq ) || (sym eq Object_ne )
1763
1763
1764
- @ tu lazy val assumedTransparentClasses =
1765
- Set [Symbol ](ComparableClass , ProductClass , SerializableClass ,
1766
- AnyClass , AnyValClass , ObjectClass , MatchableClass ,
1767
- // add these for now, until we had a chance to retrofit 2.13 stdlib
1768
- // we should do a more through sweep through it then.
1769
- requiredClass(" scala.collection.IterableOps" ),
1770
- requiredClass(" scala.collection.SeqOps" ),
1771
- requiredClass(" scala.collection.SortedOps" ),
1772
- requiredClass(" scala.collection.StrictOptimizedSortedSetOps" ),
1773
- requiredClass(" scala.collection.generic.DefaultSerializable" ),
1774
- requiredClass(" scala.collection.generic.IsIterable" ),
1775
- requiredClass(" scala.collection.generic.IsIterableOnce" ),
1776
- requiredClass(" scala.collection.generic.IsMap" ),
1777
- requiredClass(" scala.collection.generic.IsSeq" ),
1778
- requiredClass(" scala.collection.generic.Subtractable" ),
1779
- requiredClass(" scala.collection.immutable.StrictOptimizedSeqOps" ),
1780
- )
1764
+ @ tu lazy val assumedTransparentNames : Map [Name , Set [Symbol ]] =
1765
+ // add these for now, until we had a chance to retrofit 2.13 stdlib
1766
+ // we should do a more through sweep through it then.
1767
+ val strs = Map (
1768
+ " Any" -> Set (" scala" , " scala.scalajs.js" ),
1769
+ " AnyVal" -> Set (" scala" ),
1770
+ " Matchable" -> Set (" scala" ),
1771
+ " Product" -> Set (" scala" ),
1772
+ " Object" -> Set (" java.lang" , " scala.scalajs.js" ),
1773
+ " Comparable" -> Set (" java.lang" ),
1774
+ " Serializable" -> Set (" java.io" ),
1775
+ " BitSetOps" -> Set (" scala.collection" ),
1776
+ " IndexedSeqOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1777
+ " IterableOnceOps" -> Set (" scala.collection" ),
1778
+ " IterableOps" -> Set (" scala.collection" ),
1779
+ " LinearSeqOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1780
+ " MapOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1781
+ " SeqOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1782
+ " SetOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1783
+ " SortedMapOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1784
+ " SortedOps" -> Set (" scala.collection" ),
1785
+ " SortedSetOps" -> Set (" scala.collection" , " scala.collection.mutable" , " scala.collection.immutable" ),
1786
+ " StrictOptimizedIterableOps" -> Set (" scala.collection" ),
1787
+ " StrictOptimizedLinearSeqOps" -> Set (" scala.collection" ),
1788
+ " StrictOptimizedMapOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1789
+ " StrictOptimizedSeqOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1790
+ " StrictOptimizedSetOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1791
+ " StrictOptimizedSortedMapOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1792
+ " StrictOptimizedSortedSetOps" -> Set (" scala.collection" , " scala.collection.immutable" ),
1793
+ " ArrayDequeOps" -> Set (" scala.collection.mutable" ),
1794
+ " DefaultSerializable" -> Set (" scala.collection.generic" ),
1795
+ " IsIterable" -> Set (" scala.collection.generic" ),
1796
+ " IsIterableLowPriority" -> Set (" scala.collection.generic" ),
1797
+ " IsIterableOnce" -> Set (" scala.collection.generic" ),
1798
+ " IsIterableOnceLowPriority" -> Set (" scala.collection.generic" ),
1799
+ " IsMap" -> Set (" scala.collection.generic" ),
1800
+ " IsSeq" -> Set (" scala.collection.generic" ))
1801
+ strs.map { case (simple, pkgs) => (
1802
+ simple.toTypeName,
1803
+ pkgs.map(pkg => staticRef(pkg.toTermName, isPackage = true ).symbol.moduleClass)
1804
+ )
1805
+ }
1806
+
1807
+ def isAssumedTransparent (sym : Symbol ): Boolean =
1808
+ assumedTransparentNames.get(sym.name) match
1809
+ case Some (pkgs) => pkgs.contains(sym.owner)
1810
+ case none => false
1781
1811
1782
1812
// ----- primitive value class machinery ------------------------------------------
1783
1813
0 commit comments