We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'd love to be able to write:
def foo(tree: context.Tree)(implicit context: Context): context.Tree
More info here: http://groups.google.com/group/scala-internals/browse_thread/thread/e73e55f5b2456bd8
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-5502?orig=1 Reporter: @xeno-by
Sorry, something went wrong.
@lrytz said: maybe workaround:
foo[T <: Singleton with Context](tree: T#Tree)(implicit ctx: T): ctx.Tree
for now, close as "need a sip" at least
@milessabin said: A bit of a disappointing resolution. Nevertheless the workaround is ... workable. Version that actually compiles looks like this,
scala> trait Context { trait Tree } defined trait Context scala> def foo [T <: Context](tree : T#Tree)(implicit ctx : T) : ctx.Tree = null foo: [T <: Context](tree: T#Tree)(implicit ctx: T)ctx.Tree scala> implicit val context = new Context {} context: Object with Context = $anon$1@757456c4 scala> val tree = new context.Tree {} tree: Object with context.Tree = $anon$1@1f5311a4 scala> foo(tree) res0: context.Tree = null
Nb. no Singleton.
Singleton
No branches or pull requests
I'd love to be able to write:
More info here: http://groups.google.com/group/scala-internals/browse_thread/thread/e73e55f5b2456bd8
The text was updated successfully, but these errors were encountered: