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.

given T = summon[T] sometimes loops forever

See original GitHub issue

Compiler version

3.2.0

Minimized code

package Scope:
  class BaseClass:
    opaque type Opaque = Foo
    given TypeClass[Opaque] = summon[TypeClass[Opaque]]
    def getFoo: Foo = Foo()

  class SubClass extends BaseClass:
    override def getFoo: Opaque & Foo = new Foo().asInstanceOf[Opaque & Foo]

  class Foo

  trait TypeClass[T]:
    extension (b: T)
      def other: T

  given TypeClass[Foo] with
    extension (b: Foo)
      final def other: Foo = ???

@main def main(): Unit =
  val instance = Scope.SubClass()
  val concrete = instance.getFoo
  println("About to hang")
  val other = concrete.other
  println("Never reached")

Output

About to hang

Expectation

Termination (with a runtime error)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
oderskycommented, Oct 12, 2022

So I can think we can safely close this now.

3reactions
kyri-petroucommented, Oct 12, 2022

I see warnings for all three summons that were shown in the examples above

Okay I see, I was using Scala 3.2.0 which doesn’t produce any warnings, but 3.2.1-RC1 and 3.2.1-RC2 do. Apologies for not checking that beforehand

Read more comments on GitHub >

github_iconTop Results From Across the Web

Special Summoning condition | Yu-Gi-Oh! Wiki - Fandom
This is a blanket Summon Condition that forbids the card from being Special Summoned by any means, be it from the hand, Deck,...
Read more >
Forum:Deck Guide/Decks and Loops - Yu-Gi-Oh! wiki
Some loops can go on forever, winning you the game or simply stalling for time (the "Flint Lock" and "Butterfly Dagger - Elma"...
Read more >
Bruno Major - To Let A Good Thing Die (Official Audio)
You can't summon love up in your heart, If it isn't there at all. ... tear from your eye, Cos sometimes it's time...
Read more >
Note for people summoning visitors : r/Nioh - Reddit
The second part is, it takes forever to summon some one. ... While it's preferable for people to learn the fights, sometimes you...
Read more >
GGST - Jack-O - Dustloop
Jack-O' is a momentum-based fighter summoning Servants that fight by ... often making her dependent on Forever Elysion Driver for damage.
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