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

PartialFunction literals leak implementation details / shadow "default" #8329

Closed
scabug opened this issue Feb 22, 2014 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Feb 22, 2014

The following demonstrates the problem:

def foo(pf: PartialFunction[Any, Unit]) = ()

def bar(default: String) = foo {
  case _ => val x: String = default
}

Inside the PF literal, the symbol default is shadowed by something that must be synthetically generated:

<console>:9: error: type mismatch;
 found   : A1 => B1
 required: String
         case _ => val x: String = default
                                   ^
@scabug
Copy link
Author

scabug commented Feb 22, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8329?orig=1
Reporter: @Sciss
Affected Versions: 2.10.3, 2.11.0-M8

@scabug
Copy link
Author

scabug commented Feb 22, 2014

@retronym said:
Good catch, Sciss!

I think this fixes it:

https://github.com/retronym/scala/compare/ticket;8329?expand=1

I don't think this will make 2.11.0 as we're really close to RC1. But we can target 2.11.1, and probably backport to 2.10.5

@scabug
Copy link
Author

scabug commented Mar 15, 2014

@retronym said:
#8329

@scabug scabug closed this as completed Apr 21, 2014
@scabug scabug added this to the 2.11.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants