question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chain of two `given...with` fail to fetch dependent type

See original GitHub issue

Chain of two given..with dependencies fail to fetch dependent type. If IntCandidate in the example below uses transparent inline given then there is no error.

Compiler version

v3.1.0-RC2

Minimized code

scastie: https://scastie.scala-lang.org/k7wmGYQOQtCteA4IrDmJ7g

trait IntWidth {type Out}
given IntWidth with {type Out = 155}

trait IntCandidate {type Out}
given (using w: IntWidth): IntCandidate with {type Out = w.Out}

val x = summon[IntCandidate]
val xx = summon[x.Out =:= 155]

Output

Cannot prove that x.Out =:= (155 : Int).

Expectation

No error.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
oderskycommented, Sep 30, 2021

That sounds scary. I think it should remain opt-in.

But the underlying problem of dependent class constructors is definitely worth attacking!

1reaction
esse-bytecommented, Sep 23, 2021

Note: the Aux pattern works here scastie: aux pattern

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Apollo Link to Handle Dependent Queries
Given the example above, the user's profile screen needs to run two queries. One to get the user's information and their planet's ID:...
Read more >
using a fetch inside another fetch in javascript - Stack Overflow
Fetch returns a promise, and you can chain multiple promises, and use the result of the 1st request in the 2nd request, and...
Read more >
Promises chaining - The Modern JavaScript Tutorial
This feature allows us to integrate custom objects with promise chains without having to inherit from Promise . Bigger example: fetch. In ...
Read more >
Chain HTTP Requests in React Using Promises - Pluralsight
You can easily complete this feature by using the Fetch and Promise APIs. The below code is an example of how you might...
Read more >
Troubleshooting errors in AWS Glue
Error : Job run failed because the role passed should be given assume role permissions ... For more information, see Step 2: Create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found