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

val f : Q[Int] = { case a : Int => a } slains the compiler #6258

Closed
scabug opened this issue Aug 19, 2012 · 4 comments
Closed

val f : Q[Int] = { case a : Int => a } slains the compiler #6258

scabug opened this issue Aug 19, 2012 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Aug 19, 2012

import language.existentials

object test {
    type Q[R] = PartialFunction[B, R] forSome { type B }
    val f : Q[Int] = { case a : Int => a }
}
     while compiling: test.scala
        during phase: refchecks
     library version: version 2.10.0-M6
    compiler version: version 2.10.0-M6
  reconstructed args: -feature

  last tree to typer: Ident(x)
              symbol: value x (flags: <param> <synthetic>)
   symbol definition: x: Boolean
                 tpe: Boolean
       symbol owners: value x
      context owners: anonymous class $anonfun -> value f -> object test -> package <empty>
[...]
== Expanded type of tree ==

TypeRef(TypeSymbol(final abstract class Boolean extends AnyVal))

uncaught exception during compilation: scala.MatchError
error: scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.traverse(RefChecks.scala:971)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.traverse(RefChecks.scala:842)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:1734)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:108)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformTypeDefs$1.apply(Trees.scala:653)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformTypeDefs$1.apply(Trees.scala:653)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
[...]
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1550)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1546)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1656)
	at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
	at scala.tools.nsc.Main$.doCompile(Main.scala:79)
	at scala.tools.nsc.Driver.process(Driver.scala:54)
	at scala.tools.nsc.Driver.main(Driver.scala:67)
	at scala.tools.nsc.Main.main(Main.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 19, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6258?orig=1
Reporter: Evgeny (akshaal)
Affected Versions: 2.10.0-M6
Other Milestones: 2.10.0
Attachments:

  • crash.log (created on Aug 19, 2012 1:28:23 AM UTC, 28759 bytes)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 19, 2012

Evgeny (akshaal) said:
oneliner:

val f : PartialFunction[_, Int] = { case a : Int => a }
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 19, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 20, 2012

@scabug scabug closed this Sep 7, 2012
@scabug scabug added this to the 2.10.0-M7 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.