You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the output of the REPL when pasting the content of the attached file. First of all, I wouldn't expect any error. Second, this error message is confusing:
classOption has one typeparameter, but typeF has one
$ ./scala-2.12.0-RC1/bin/scala
Welcome to Scala2.12.0-RC1 (JavaHotSpot(TM) 64-BitServerVM, Java1.8.0_102).
Type in expressions for evaluation. Ortry:help.
scala>:paste
// Entering paste mode (ctrl-D to finish)importscala.language.higherKindstraitFoo[A] {
typeF[_]
}
objectFoo {
// two identical auxiliary type aliasestypeAux1[A, F0[_]] =Foo[A] { typeF[X] =F0[X] }
typeAux2[A, F0[_]] =Foo[A] { typeF[X] =F0[X] }
defbar[A, F[_]](a: A)(implicitev: Foo.Aux1[A, F]):Foo.Aux1[A, F] = ev
implicitdefev:Foo.Aux1[String, Option] =newFoo[String] { typeF[X] =Option[X] }
valfooStringOption:Foo.Aux2[String, Option] = bar("hi")
}
// Exiting paste mode, now interpreting.
<console>:26:error: inferred kinds of the typearguments (String,Option[X]) do not conform to the expected kinds of the typeparameters (typeA,typeF).
Option[X]'stypeparametersdo not matchtypeF's expected parameters:
classOption has one typeparameter, but typeF has one
valfooStringOption:Foo.Aux2[String, Option] = bar("hi")
^
<console>:26:error: typemismatch;
found : String("hi")
required: AvalfooStringOption:Foo.Aux2[String, Option] = bar("hi")
^
scala>
The text was updated successfully, but these errors were encountered:
Below is the output of the REPL when pasting the content of the attached file. First of all, I wouldn't expect any error. Second, this error message is confusing:
The text was updated successfully, but these errors were encountered: