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

Multiline implicit param list bug #263

Open
tim-zh opened this issue Nov 17, 2017 · 7 comments
Open

Multiline implicit param list bug #263

tim-zh opened this issue Nov 17, 2017 · 7 comments

Comments

@tim-zh
Copy link

tim-zh commented Nov 17, 2017

def f(implicit i: Int,
      j: Int): Unit

is formatted to

def f(impliciti: Int,
    j: Int
): Unit

(default config, "org.scalariform" % "sbt-scalariform" % "1.8.2", sbt.version = 1.0.3)

@c-dante
Copy link

c-dante commented Feb 21, 2018

Same lexer bug I pointed out in #260, probably also related to how dangling paren is set up

@oporkka
Copy link

oporkka commented Mar 19, 2018

What is the expected result?

@normana400
Copy link

normana400 commented Mar 20, 2019

this is still happening with scalariform. when you are using implicits the space between the word "implicit" and the name of the parameter should not be lost.

in other words (implicit foo : String should not be reformatted to (implicitfoo : String

@godenji
Copy link
Collaborator

godenji commented Mar 21, 2019

@normana400 can you provide a code snippet where the formatter breaks code (not just formats oddly) in the way that describe?

@normana400
Copy link

the above example is broken code. implicit is a language keyword. To have a language keyword get mixed into the name changes the behavior of the code and also creates a compile error with the code that attempts to reference the true (non corrupted) name of the value. Did that answer your question.

The example at the top of the thread should be all you need to reproduce.

@normana400
Copy link

I think the scenario happens whenever there is an implicit parameter that shares a signature with non implicit parameters

@normana400
Copy link

normana400 commented Apr 30, 2019

class Foo{
  def f(implicit i: Int,
      j: Int): Unit = {
    i
    j
 }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants