ghostbuster91/scalafix-unified

Replaces the `Nil` in pattern matching

Closed this issue ยท 2 comments

I was having something like this in my code:

args match {
  case a :: b :: Nil => ..
  ...  
}

And the plugin replaced the Nil by List.empty:

args match {
  case a :: b :: List.Empty => ..
  ...  
}

which obviously doesn't compile ๐Ÿ˜…

Hi,

You probably tried 0.0.4 version which was indeed broken in that way. There was another version 0.0.6 but I forgot to update the releases. Didn't setup release drafter yet.

0.0.6 on the other hand rewrites all the list construction to List.empty (including non-empty lists ๐Ÿ˜‚ ).

I just pushed 0.0.7 which seems to be fixing that problem :) Should be available in maven central in few hours.

Hi :)

including non-empty lists

Ahah, that's an interesting behaviour ๐Ÿ˜„

I just pushed 0.0.7

Amazing! Will give it a try tomorrow! :)