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

having - requires explicit type parameter on higher kinded types #12

Closed
nargov opened this issue May 23, 2016 · 1 comment
Closed

having - requires explicit type parameter on higher kinded types #12

nargov opened this issue May 23, 2016 · 1 comment
Labels

Comments

@nargov
Copy link
Contributor

nargov commented May 23, 2016

If a class is defined with type parameters such as

class HigherKind[T](kind: T)

Then this code does not compile:

"support having with higher kinded types" in new Context {
  val dummy = mock[Dummy]
  checking {
    oneOf(dummy).higherKinded(having(any[HigherKind[_]]))
  }
  dummy.higherKinded(new HigherKind("123"))
}

The error message is:

Error:(285, 41) type mismatch;
 found   : org.specs2.matcher.Matcher[com.wix.common.specs2.HigherKind[_]]
 required: com.wix.common.specs2.HigherKind[_]
        oneOf(dummy).higherKinded(having(any[HigherKind[_]]))
                                        ^

while adding the explicit type parameter on having gets it to compile.

"support having with higher kinded types" in new Context {
  val dummy = mock[Dummy]
  checking {
    oneOf(dummy).higherKinded(having[HigherKind[_]](any[HigherKind[_]]))
  }
  dummy.higherKinded(new HigherKind("123"))
}
@nargov nargov added the bug label May 23, 2016
@nargov
Copy link
Contributor Author

nargov commented May 24, 2016

Fixed in #13.

@nargov nargov closed this as completed May 24, 2016
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

1 participant