Dotty: Implicit class with two arguments does not fail compilation

Created on 23 Nov 2017  路  4Comments  路  Source: lampepfl/dotty

object Test {
  implicit class Foo(i: Int, s: String)
}

Fails in scalac with

Foo.scala:2: error: implicit classes must accept exactly one primary constructor parameter
  implicit class Foo(i: Int, s: String)
                 ^
one error found

But not on dotc. This error should probably be emitted when desugaring the implicit class.

intermediate help wanted bug

All 4 comments

I'd like to give it a try.

Would you recommend to work on the #2464 first?

-V

I would start with this one. It might as well fix #2464

OK. Thanks, Allan.

Yes, you should start with this one.

2464 has some additional complex interaction with phantom types. If you fix this one you will partially #2464, at least for 99.99 of the use cases. But do not close that one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

odersky picture odersky  路  126Comments

odersky picture odersky  路  66Comments

TomasMikula picture TomasMikula  路  28Comments

odersky picture odersky  路  60Comments

odersky picture odersky  路  94Comments