given T = summon[T] sometimes loops forever
See original GitHub issueCompiler 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:
- Created a year ago
- Reactions:1
- Comments:20 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I can think we can safely close this now.
Okay I see, I was using Scala
3.2.0
which doesn’t produce any warnings, but3.2.1-RC1
and3.2.1-RC2
do. Apologies for not checking that beforehand