Skip to content

Instantly share code, notes, and snippets.

@aroberts
Created May 2, 2017 14:44
Show Gist options
  • Save aroberts/f4c1ffd2f51b05943bbc54b5cc066f1e to your computer and use it in GitHub Desktop.
Save aroberts/f4c1ffd2f51b05943bbc54b5cc066f1e to your computer and use it in GitHub Desktop.
Intellij Scala plugin: Failure to infer class type parameters from parameter list when an implicit parameter list is present
package com.fuze.perseus.flink
class FailingExample[T](s: Concrete[T])(implicit tc: Typeclass[T])
class WorkingExample[T](s: Concrete[T])
trait Typeclass[T]
trait Concrete[T]
object Concrete {
val instance = new Concrete[Int] {}
}
object Example {
// inspecting types with View > Type Info (defaults to Ctrl + Shift + P)
// type of `fail` is inferred to be `FailingExample[Nothing]`
val fail = new FailingExample(Concrete.instance)
// type of `works` is inferred to be `WorkingExample[Int]`
val works = new WorkingExample(Concrete.instance)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment