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

Crash during implicit search with type bounds involved #7509

Closed
scabug opened this issue May 23, 2013 · 3 comments
Closed

Crash during implicit search with type bounds involved #7509

scabug opened this issue May 23, 2013 · 3 comments

Comments

@scabug
Copy link

scabug commented May 23, 2013

Trying to compile:

object MNWE extends App {
  def crash[R <: AnyRef](f: R)(implicit ev: R): Any = ???
  crash(42)
}

Correct behaviour in 2.10.1:

[info] Compiling 1 Scala source to C:\MNWE\target\scala-2.10\classes...
[error] C:\MNWE\src\main\scala\MNWE.scala:3: inferred type arguments [Int] do not conform to method crash's type parameter bounds [R <: AnyRef]
[error]   crash(42)
[error]   ^
[error] C:\MNWE\src\main\scala\MNWE.scala:3: type mismatch;
[error]  found   : Int(42)
[error]  required: R
[error]   crash(42)
[error]         ^
[error] C:\MNWE\src\main\scala\MNWE.scala:3: could not find implicit value for parameter ev: R
[error]   crash(42)
[error]        ^
[error] three errors found

In 2.10.2-RC1: (see Attachment)

MNWE.this.crash[R](42)
	at scala.tools.nsc.typechecker.Typers$Typer.tryNamesDefaults$1(Typers.scala:3273)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3309)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4589)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4621)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5526)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5604)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:870)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1126)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5622)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2926)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3030)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3030)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3030)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1919)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1800)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5604)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2926)
@scabug
Copy link
Author

scabug commented May 23, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7509?orig=1
Reporter: Raphael Schweizer (rch)
Affected Versions: 2.10.2-RC1, 2.11.0-M3
See #7238
Attachments:

  • Crashlog.txt (created on May 23, 2013 12:24:22 PM UTC, 14065 bytes)

@scabug
Copy link
Author

scabug commented May 23, 2013

@retronym said (edited on May 23, 2013 6:59:20 PM UTC):
Regression is mine: scala/scala@745c36a / #7238

@scabug
Copy link
Author

scabug commented May 23, 2013

@retronym said:
scala/scala#2588

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

3 participants