softwaremill / softwaremill/macwire

Unclear compilation error using valsByClass

Open
#6 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.3k
Forks
77
Avg merge
9m
Merged PRs (30d)
4

Description

I get the following error trying to compile Global.scala for play framework

[error] C:\Trader\app\Global.scala:7: type mismatch;
[error] found : Any
[error] required: AnyRef
[error] val instanceLookup = InstanceLookup(valsByClass(ProdModule))
[error] ^

ProdModule is an object and inherits from other traits. My problem is I cannot understand what causes this error or how to debug it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the compilation error in Global.scala, especially the valsByClass(ProdModule) expression passed to InstanceLookup. Trace the inferred types of ProdModule and valsByClass and compare them with the type InstanceLookup accepts. Done means explaining the Any versus AnyRef mismatch and identifying whether the library or the calling code needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.