Comments (10)
Thinking how to go forward on this issue, I think it would be best to get rid of the split packages. Instead, the scala-collection-compat
library should only expose types in the scala.collection.compat
package.
This means we'd put the Factory
and BuildFrom
and ArraySeq
(maybe collection.compat.immutable.ArraySeq
?) classes into the compat package. In the 2.13 version, they would be type aliases.
Code that cross-compiles would use collection.compat.Factory
. Once the library moves to 2.13 only, the code can change to collection.Factory
.
from scala-collection-compat.
Oh, it threw out everything that's not in the compat package... Too bad I didn't notice when looking at the jar.
from scala-collection-compat.
What is the purpose of this osgi setting?
from scala-collection-compat.
To use our jars with osgi they need to define metadata. Split packages are problematic, search on google. I personally have no experience with osgi, few people around me do. But the metadata is improtant for those that want to use it. Our working mode is to continue emitting the metadata, rely on the community to report and fix issues.
In any case, split packages will also cause problems with the java module system.
from scala-collection-compat.
Ok, I think your solution would work well.
from scala-collection-compat.
Note: the idea of putting ArraySeq
into the collection.compat.immutable
package is not a good one. Having two immutable
packages has too much potential to cause conflicts and confusion.
from scala-collection-compat.
The only problematic case I can think of is :
import collection.immutable
import collection.compat._
immutable.Something
Because in the last line immutable
confusingly refers to the one in the compat
object.
We can document this wart. I don't expect people to often import collection.immutable
(in contrast with collection.mutable
).
from scala-collection-compat.
I don't know how much of a problem this really is for OSGi. The library is coupled tightly to the standard library anyway so a split package might be just fine. AFAIK Java 9 modules don't support split packages though, so we may have to change it for that reason alone (i.e. if we want to support modules).
from scala-collection-compat.
I'm really not sure we should reuse immutable
. I think we cannot just assume that noone imports collection.immutable
.
scala> :pa -raw
// Entering paste mode (ctrl-D to finish)
package a { package imm { class C } }
package b { package imm { class D } }
// Exiting paste mode, now interpreting.
scala> import a._, b._
import a._
import b._
scala> new imm.C
res4: a.imm.C = a.imm.C@7761e342
scala> new imm.D
^
error: type D is not a member of package a.imm
from scala-collection-compat.
@lrytz Not sure what's on your previous lines. Normally, it's ambiguous, but REPL nests the imports. You don't need -raw
for packages.
scala 2.12.6> :pa
// Entering paste mode (ctrl-D to finish)
package a { package imm { class C } }
package b { package imm { class D } }
// Exiting paste mode, now interpreting.
scala 2.12.6> import a._, b._
import a._
import b._
scala 2.12.6> new imm.C
<console>:18: error: type C is not a member of package b.imm
new imm.C
^
from scala-collection-compat.
Related Issues (20)
- Cannot construct a collection of type TraversableOnce[A] with elements of type A based on a collection of type TraversableOnce[A]
- scalafix can't find 'RoughlyMapValues' HOT 9
- duplicate scala/annotation/nowarn.class with different file contents HOT 2
- Roll a release to publish for Scala 3 Native HOT 2
- scala.jdk.OptionConverters missing? HOT 2
- Roll 2.8.0 release HOT 5
- add `distinctBy` HOT 3
- Roll a release (2.8.1) HOT 4
- Add `.toXOption` methods from `StringOps` HOT 7
- For security, prevent `Function0` execution during `LazyList` deserialization (backport from 2.13)
- readme should document Metals setup HOT 1
- Roll a release (2.9.0) HOT 1
- Using(new Source(...)) for Scala 2.11 HOT 4
- `maxBefore` and `minAfter` for `SortedSet`, `SortedMap`
- Roll a release (2.10.0) HOT 2
- Roll a release (2.11.0)
- `unfold` method for `Iterable` companion sub classes
- add `appended` method
- Will there be a new release for 2.7? HOT 3
- `Left#withRight` and `Right#withLeft`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-collection-compat.