Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2012 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3993598 to your computer and use it in GitHub Desktop.
Save anonymous/3993598 to your computer and use it in GitHub Desktop.
Scala -Yinfer-debug output
D:\Develop\Temp\multiple_implicits.scala:8: error: type mismatch;
found : this.Foo
required: this.Zip
val zip2: Zip = Foo(3) // <- compiler error, implicit conversion not applied
^
one error found
inferMethodInstance {
fn scala.Some.apply[A]
undetparams type A
args x$0.i
pt0 ?
}
methTypeArgs {
tparams type A
formals A
restpe Some[A]
restpeInst Some[?A]
argtpes Int
pt ?
tvars ?A
constraints [ _>:() | _<:() ] _= <notype>
}
methTypeArgs result {
tvars Int
constraints [ _>:(Int) | _<:() ] _= Int
targs Int
adjusted type args type A -> Some(Int)
}
inferMethodInstance {
fn scala.Some.apply[A]
undetparams type A
args x$0.i
pt0 ?
}
methTypeArgs {
tparams type A
formals A
restpe Some[A]
restpeInst Some[?A]
argtpes Int
pt ?
tvars ?A
constraints [ _>:() | _<:() ] _= <notype>
}
methTypeArgs result {
tvars Int
constraints [ _>:(Int) | _<:() ] _= Int
targs Int
adjusted type args type A -> Some(Int)
}
[inferImplicit view] pt = this.Foo => this.Zip
Implicit search in Context(Main.$anon.zip2@ValDef scope=1100551785) {
search this.Foo => this.Zip
target $anon.this.Foo.apply(3)
isView true
eligible toT: [T](foo: this.Foo)(implicit g: Int => T)T
}
[typedImplicit] toT: [T](foo: this.Foo)(implicit g: Int => T)T
inferMethodInstance {
fn $anon.this.toT[T]
undetparams type T
args <argument>
pt0 this.Zip
}
methTypeArgs {
tparams type T
formals this.Foo
restpe (implicit g: Int => T)T
restpeInst (implicit g: Int => ?T)?T
argtpes this.Foo
pt this.Zip
tvars ?T
constraints [ _>:() | _<:() ] _= <notype>
}
methTypeArgs result {
tvars Nothing
constraints [ _>:() | _<:(this.Zip) ] _= Nothing
targs Nothing
adjusted type args type T -> None
}
inferMethodInstance, still undetermined: List(type T)
[companionImplicitMap] this.Foo => this.Zip = Map()
[inferImplicit] result: SearchResult(<empty>, )
[inferImplicit view] pt = => this.Foo => this.Zip
Implicit search in Context(Main.$anon.zip2@ValDef scope=1100551785) {
search => this.Foo => this.Zip
target $anon.this.Foo.apply(3)
isView true
}
[companionImplicitMap] => this.Foo => this.Zip = Map()
[inferImplicit] result: SearchResult(<empty>, )
<<< Process finished.
================ READY ================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment