zinc icon indicating copy to clipboard operation
zinc copied to clipboard

Zinc doesn't notice that `implicit` keyword has been removed from a method

Open dwijnand opened this issue 5 years ago • 1 comments

In incremental builds the compiler doesn't notice that implicit keyword has been removed from a method and still uses the now not implicit definition instead of rerunning the search, but I assume this is well known.

Originally posted by @noresttherein in https://github.com/scala/bug/issues/12231#issuecomment-730467095

dwijnand avatar Nov 19 '20 19:11 dwijnand

I must add that it certainly is not always so and I tried to provide a minimized example without success, but these things, depending on the history of changes, are tricky. Just in order to not look like an idiot, here it is in the wild: oldsql commit

Reproduction steps: in src/tests/scala/playground.scala (or any scratch file, for that matter) put:

	println(scala.reflect.runtime.universe.reify (
		implicitly[SQLReadForm[Option[Int]]]
	).tree)

It should print:

Predef.implicitly[SQLReadForm[Option[Int]]](SQLForms.OptionColumnReadForm(SQLForms.IntForm))

Then: 1. navigate to src/main/scala/net/noresttherein/oldsql.schema/forms/SQLForms.scala 2. find trait ColumnRWFormsImplicits 3. remove the implicit keyword from method OptionColumnReadForm 4. recompile 5. run playground or your scratch file again

The result is the same as before, while it should print:

Predef.implicitly[SQLReadForm[Option[Int]]](SQLForms.OptionSQLReadForm(SQLForms.IntForm))

I might have a go at it minimizing it again, but for now fighting with other issues with implicits made me almost cry and I need a break.

noresttherein avatar Nov 19 '20 20:11 noresttherein