Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler hangs when match returns different types #9018

Closed
scabug opened this issue Nov 29, 2014 · 3 comments
Closed

Compiler hangs when match returns different types #9018

scabug opened this issue Nov 29, 2014 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 29, 2014

Works fine with scala 2.10.4

Minimized example:

object TestObject {

    def m(i: Int): AnyRef = i match {
        case 0 => new C()
        case 1 => Some(E.A).getOrElse("")
    }

    class C extends Ordered[C] {
        def compare(that: C): Int = ???
    }

    object E extends Enumeration {
        type E = Value
        val A = Value
    }
}

End of output when compiling with -verbose:

[typer in -1416506817514ms]
[loaded package loader util in -1416506818115ms]
[loaded class file C:\PROGRA~2\scala\bin\..\lib\scala-continuations-library_2.11-1.0.2.jar(scala/util/continuations/package.class) in -1416506818113ms]
[loaded package loader continuations in -1416506818111ms]
[loaded class file C:\PROGRA~2\scala\bin\..\lib\scala-continuations-library_2.11-1.0.2.jar(scala/util/continuations/cpsPlus.class) in -1416506818113ms]
[loaded class file C:\PROGRA~2\scala\bin\..\lib\scala-library.jar(scala/MatchError.class) in -1416506818114ms]
[loaded class file C:\Program Files (x86)\Java\jdk1.7.0_55\jre\lib\rt.jar(java/lang/RuntimeException.class) in -1416506818113ms]
[loaded class file C:\Program Files (x86)\Java\jdk1.7.0_55\jre\lib\rt.jar(java/lang/Exception.class) in -1416506818113ms]
@scabug
Copy link
Author

scabug commented Nov 29, 2014

Imported From: https://issues.scala-lang.org/browse/SI-9018?orig=1
Reporter: Marek Gawlicki (marqxx)
Affected Versions: 2.11.4

@scabug
Copy link
Author

scabug commented Dec 1, 2014

@retronym said:
Regressed in scala/scala@4412a92. I have a patch pending at https://github.com/retronym/scala/tree/ticket/9018

@scabug
Copy link
Author

scabug commented Dec 1, 2014

@retronym said:
scala/scala#4178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants