Giter VIP home page Giter VIP logo

Comments (3)

Gedochao avatar Gedochao commented on June 20, 2024

Crashes

I wasn't able to reproduce the crash.
Assuming this to just be a reporting issue.

from scala3.

Gedochao avatar Gedochao commented on June 20, 2024

Ah, right. There's no crash, but the code fails by throwing an exception at runtime when run as a script.

// repro-script.sc
sealed trait T_A[B]
sealed trait T_B[C]
case class CC_B[C]() extends T_A[T_B[C]]
case class CC_C[B, C](c: T_A[B], d: T_B[C]) extends T_B[C]
case class CC_E[C]() extends T_B[C]

val v_a: T_B[Int] = CC_C(null, CC_E())
val v_b: Int = v_a match {
  case CC_C(_, CC_C(_, _)) => 0
  case CC_E()              => 5
}
scala-cli run repro-script.sc
Compiling project (Scala 3.4.2, JVM (17))
Compiled project (Scala 3.4.2, JVM (17))
Exception in thread "main" scala.MatchError: CC_C(null,CC_E()) (of class repro$minusscript$_$CC_C)
        at repro$minusscript$_.<init>(repro-script.sc:10)
        at repro$minusscript_sc$.script$lzyINIT1(repro-script.sc:25)
        at repro$minusscript_sc$.script(repro-script.sc:25)
        at repro$minusscript_sc$.main(repro-script.sc:29)
        at repro$minusscript_sc.main(repro-script.sc)

from scala3.

Gedochao avatar Gedochao commented on June 20, 2024

Very similar issues which were reported together with this, potentially duplicates:

from scala3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.