Feature request: wiring abstract classes and traits
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start with the Scala reproduction in the issue and inspect how macwire currently handles constructor arguments, abstract classes, and traits. Define completion as making both wire[Abs] and wire[T] compile when their abstract members can be satisfied, while preserving the existing error behavior when they cannot.
Written by the indexing model from the issue text.
Description
The following does not compile:
object Foo {
trait Dep
abstract class Abs {
def foo: Dep
}
trait T {
def bar: Dep
}
val d: Dep = new Dep {}
val a: Abs = wire[Abs]
val t: T = wire[T]
def main(args: Array[String]): Unit =
println(s"a.foo ${a.foo}")
}
MacWire says
Error: class Abs is abstract; cannot be instantiated
val a: Abs = wire[Abs]
Error: Cannot find a public constructor nor a companion object for [Foo.T]
val t: T = wire[T]
It would be nice if macwire could wire abstract classes and traits when it can satisfy abstract members like it does for constructor args.
- Dominant language
- Scala
- Stars
- 1.3k
- Forks
- 77
- Avg merge
- 9m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from softwaremill/macwire
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
softwaremill/macwire#412 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
softwaremill/macwire#391 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
softwaremill/macwire#301 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
softwaremill/macwire#281 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
softwaremill/macwire#278 · 3 comments ·
All issues in softwaremill/macwire
Similar issues
-
Area: Excel support
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
orbeon/orbeon-forms#7893 ·
-
ShuffleManagerRegistry.register recursion guard is inverted, permits GlutenShuffleManager subclasses Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100