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

type error without line number with Long and higher-kinded types #8463

Closed
scabug opened this issue Mar 30, 2014 · 8 comments
Closed

type error without line number with Long and higher-kinded types #8463

scabug opened this issue Mar 30, 2014 · 8 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Mar 30, 2014

This seems related to: #8219

Reproduce code:

  case class Foo[+T[_]](activity:T[Long])
  type Cell[T] = T
  def insertCell(u:Foo[Cell]) = ???
  insertCell(Foo(5))

Expected result:
Type error with line numer.

Actual result:

[error] type mismatch;
[error]  found   : Long
[error]  required: ?T
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error]  both method longWrapper in class LowPriorityImplicits of type (x: Long)scala.runtime.RichLong
[error]  and method any2Ensuring in object Predef of type [A](x: A)Ensuring[A]
[error]  are possible conversion functions from Long to ?T

It seems to be related to using a type alias and a long. Those all produce type errors with line numbers:

  case class Foo2[+T[_]](color:T[String])
  def insertCell2(u:Foo2[Cell]) = ???
  insertCell2(Foo2("color"))

  def insertOption(u:Foo[Option]) = ???
  insertOption(Foo(5))

  def insertOption2(u:Foo2[Option]) = ???
  insertOption2(Foo2("color"))

Another code sample that produces the same error message without line number:

  class DefaultType[Name]
  case class Foo[+T[_]](
    activity:T[Long]
  )(t:DefaultType[T[_]])
  Foo(3)(new DefaultType[Option[_]])
@scabug
Copy link
Author

scabug commented Mar 30, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8463?orig=1
Reporter: @cvogt
Affected Versions: 2.10.4

@scabug
Copy link
Author

scabug commented Apr 2, 2014

@retronym said:
Dup of #8219. I'll add this test case to that ticket.

I tried to fix that for 2.11.0 (in scala/scala#3460) but ran into #8230.

@scabug
Copy link
Author

scabug commented Apr 2, 2014

@retronym said:
Oh, I just realised that #8219 is closed. I'll reopen this ticket instead.

@scabug
Copy link
Author

scabug commented Apr 2, 2014

@retronym said:
This fixes the unpositioned part: scala/scala#3670

But the error message is still suboptimal.

@scabug
Copy link
Author

scabug commented Apr 2, 2014

@cvogt said:
awesome :D!

@scabug
Copy link
Author

scabug commented Aug 5, 2014

@gkossakowski said:
The 2.11.2 is out so I'm rescheduling the issue for 2.11.3.

@scabug
Copy link
Author

scabug commented Nov 4, 2014

@retronym said:
Updating fix-by version to 2.11.5.

@scabug
Copy link
Author

scabug commented Nov 6, 2014

@retronym said:
We forgot to close this ticket when the fix was merged into 2.11.1

@scabug scabug closed this as completed Nov 6, 2014
@scabug scabug added the blocker label Apr 7, 2017
@scabug scabug added this to the 2.11.1 milestone Apr 7, 2017
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

2 participants