Skip to content

Commit ac08082

Browse files
committed
Overwritte StringContex with s, f and raw as normal methods
This is enough to generate documentation and code. Code can be generated because they are spceial cased to be optimized away by the compiler.
1 parent 59e7a4f commit ac08082

File tree

3 files changed

+587
-94
lines changed

3 files changed

+587
-94
lines changed

dotty-scala-library-from-tasty-tests/test/LibraryTest.scala

Lines changed: 90 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -118,89 +118,7 @@ object TastyInspectorTest:
118118
}
119119

120120
def loadBlacklist = List[String](
121-
// object s in class StringContext does not take parameters
122-
"scala.collection.ArrayOps",
123-
"scala.collection.BitSetOps",
124-
"scala.collection.generic.DefaultSerializationProxy",
125-
"scala.collection.immutable.LazyList",
126-
"scala.collection.immutable.List",
127-
"scala.collection.immutable.Node",
128-
"scala.collection.immutable.NumericRange",
129-
"scala.collection.immutable.StrictOptimizedSeqOps",
130-
"scala.collection.immutable.TreeSeqMap",
131-
"scala.collection.immutable.Vector",
132-
"scala.collection.immutable.Vector0",
133-
"scala.collection.immutable.VectorBuilder",
134-
"scala.collection.immutable.VectorSliceBuilder",
135-
"scala.collection.immutable.WrappedString",
136-
"scala.collection.LazyZip2",
137-
"scala.collection.LazyZip3",
138-
"scala.collection.LazyZip4",
139-
"scala.collection.MapOps",
140-
"scala.collection.mutable.ArrayBuffer",
141-
"scala.collection.mutable.ArrayBufferView",
142-
"scala.collection.mutable.ArrayDeque",
143-
"scala.collection.mutable.ArrayDequeOps",
144-
"scala.collection.mutable.CollisionProofHashMap",
145-
"scala.collection.mutable.HashMap",
146-
"scala.collection.mutable.HashSet",
147-
"scala.collection.mutable.ListBuffer",
148-
"scala.collection.mutable.UnrolledBuffer",
149-
"scala.collection.SeqView",
150-
"scala.collection.StringView",
151-
"scala.concurrent.duration.Duration",
152-
"scala.concurrent.Future",
153-
"scala.Enumeration",
154-
"scala.io.Source",
155-
"scala.jdk.Accumulator",
156-
"scala.jdk.DoubleAccumulator",
157-
"scala.jdk.IntAccumulator",
158-
"scala.jdk.javaapi.DurationConverters",
159-
"scala.jdk.LongAccumulator",
160-
"scala.Product",
161-
"scala.Product1",
162-
"scala.Product10",
163-
"scala.Product11",
164-
"scala.Product12",
165-
"scala.Product13",
166-
"scala.Product14",
167-
"scala.Product15",
168-
"scala.Product16",
169-
"scala.Product17",
170-
"scala.Product18",
171-
"scala.Product19",
172-
"scala.Product2",
173-
"scala.Product20",
174-
"scala.Product21",
175-
"scala.Product22",
176-
"scala.Product3",
177-
"scala.Product4",
178-
"scala.Product5",
179-
"scala.Product6",
180-
"scala.Product7",
181-
"scala.Product8",
182-
"scala.Product9",
183-
"scala.reflect.ClassTag",
184-
"scala.runtime.ArrayCharSequence",
185-
"scala.runtime.LazyBoolean",
186-
"scala.runtime.LazyByte",
187-
"scala.runtime.LazyChar",
188-
"scala.runtime.LazyDouble",
189-
"scala.runtime.LazyFloat",
190-
"scala.runtime.LazyInt",
191-
"scala.runtime.LazyLong",
192-
"scala.runtime.LazyRef",
193-
"scala.runtime.LazyShort",
194-
"scala.runtime.LazyUnit",
195-
"scala.runtime.Tuple2Zipped",
196-
"scala.runtime.Tuple3Zipped",
197-
"scala.StringContext",
198-
"scala.sys.process.ProcessImpl",
199-
200-
// undefined: _root_.scala.StringContext.apply(["Scala "," "," -- ","" : String]:String*).f # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scala),class StringContext),f) at readTasty
201-
"scala.collection.immutable.Range",
202-
"scala.collection.Iterator",
203-
"scala.util.PropertiesTrait",
121+
// No issues :)
204122
)
205123

206124
def compileBlacklist = List[String](
@@ -238,11 +156,6 @@ object TastyInspectorTest:
238156
"scala.Unit",
239157
"scala.util.control.Breaks",
240158

241-
// class StringContext does not have a member method f
242-
"scala.collection.immutable.RedBlackTree",
243-
"scala.collection.mutable.HashTable",
244-
"scala.collection.mutable.RedBlackTree",
245-
246159
// -- Error:
247160
// | def addOne(kv: (K, V)) = {
248161
// | ^
@@ -256,16 +169,31 @@ object TastyInspectorTest:
256169
"scala.collection.concurrent.TrieMap",
257170
"scala.collection.immutable.HashMapBuilder",
258171
"scala.collection.immutable.HashSetBuilder",
172+
"scala.collection.immutable.LazyList",
259173
"scala.collection.immutable.ListMapBuilder",
260174
"scala.collection.immutable.MapBuilderImpl",
261175
"scala.collection.immutable.SetBuilderImpl",
176+
"scala.collection.immutable.TreeSeqMap",
177+
"scala.collection.immutable.Vector",
178+
"scala.collection.immutable.VectorBuilder",
262179
"scala.collection.immutable.VectorMapBuilder",
263180
"scala.collection.mutable.AnyRefMap",
264181
"scala.collection.mutable.ArrayBuilder",
182+
"scala.collection.mutable.CollisionProofHashMap",
265183
"scala.collection.mutable.LongMap",
266184
"scala.collection.mutable.SortedMap",
267185
"scala.collection.mutable.StringBuilder",
268186
"scala.jdk.AnyAccumulator",
187+
"scala.jdk.DoubleAccumulator",
188+
"scala.jdk.IntAccumulator",
189+
"scala.jdk.LongAccumulator",
190+
191+
// -- Error:
192+
// | override def filterInPlace(p: A => Boolean): this.type = {
193+
// | ^
194+
// |error overriding method filterInPlace in trait SetOps of type (p: A => Boolean): (HashSet.this : scala.collection.mutable.HashSet[A]);
195+
// | method filterInPlace of type (p: A => Boolean): (HashSet.this : scala.collection.mutable.HashSet[A]) has incompatible type
196+
"scala.collection.mutable.HashSet",
269197

270198
// -- Error:
271199
// | def force: this.type = {
@@ -284,6 +212,80 @@ object TastyInspectorTest:
284212
// at dotty.tools.dotc.transform.ExpandPrivate.transformSelect(ExpandPrivate.scala:96)
285213
"scala.util.DynamicVariable",
286214
"scala.util.Using",
215+
216+
// uncategorized issue
217+
"scala.collection.ArrayOps",
218+
"scala.collection.BitSetOps",
219+
"scala.collection.generic.DefaultSerializationProxy",
220+
"scala.collection.immutable.List",
221+
"scala.collection.immutable.Node",
222+
"scala.collection.immutable.NumericRange",
223+
"scala.collection.immutable.Range",
224+
"scala.collection.immutable.StrictOptimizedSeqOps",
225+
"scala.collection.immutable.Vector0",
226+
"scala.collection.immutable.VectorSliceBuilder",
227+
"scala.collection.immutable.WrappedString",
228+
"scala.collection.Iterator",
229+
"scala.collection.LazyZip2",
230+
"scala.collection.LazyZip3",
231+
"scala.collection.LazyZip4",
232+
"scala.collection.MapOps",
233+
"scala.collection.mutable.ArrayBuffer",
234+
"scala.collection.mutable.ArrayBufferView",
235+
"scala.collection.mutable.ArrayDeque",
236+
"scala.collection.mutable.ArrayDequeOps",
237+
"scala.collection.mutable.HashMap",
238+
"scala.collection.mutable.HashTable",
239+
"scala.collection.mutable.ListBuffer",
240+
"scala.collection.mutable.UnrolledBuffer",
241+
"scala.collection.SeqView",
242+
"scala.collection.StringView",
243+
"scala.concurrent.duration.Duration",
244+
"scala.concurrent.Future",
245+
"scala.Enumeration",
246+
"scala.io.Source",
247+
"scala.jdk.Accumulator",
248+
"scala.jdk.javaapi.DurationConverters",
249+
"scala.Product",
250+
"scala.Product1",
251+
"scala.Product10",
252+
"scala.Product11",
253+
"scala.Product12",
254+
"scala.Product13",
255+
"scala.Product14",
256+
"scala.Product15",
257+
"scala.Product16",
258+
"scala.Product17",
259+
"scala.Product18",
260+
"scala.Product19",
261+
"scala.Product2",
262+
"scala.Product20",
263+
"scala.Product21",
264+
"scala.Product22",
265+
"scala.Product3",
266+
"scala.Product4",
267+
"scala.Product5",
268+
"scala.Product6",
269+
"scala.Product7",
270+
"scala.Product8",
271+
"scala.Product9",
272+
"scala.reflect.ClassTag",
273+
"scala.runtime.ArrayCharSequence",
274+
"scala.runtime.LazyBoolean",
275+
"scala.runtime.LazyByte",
276+
"scala.runtime.LazyChar",
277+
"scala.runtime.LazyDouble",
278+
"scala.runtime.LazyFloat",
279+
"scala.runtime.LazyInt",
280+
"scala.runtime.LazyLong",
281+
"scala.runtime.LazyRef",
282+
"scala.runtime.LazyShort",
283+
"scala.runtime.LazyUnit",
284+
"scala.runtime.Tuple2Zipped",
285+
"scala.runtime.Tuple3Zipped",
286+
"scala.StringContext",
287+
"scala.sys.process.ProcessImpl",
288+
"scala.util.PropertiesTrait",
287289
)
288290

289291
def loadBlacklisted = loadBlacklist.toSet

0 commit comments

Comments
 (0)