Line continuation character in Scala

I want to split the following Scala code line like this:

ConditionParser.parseSingleCondition("field=*value1*").description 
  must equalTo("field should contain value1")

But which is the line continuation character?

Answers


Wrap it in parentheses:

(ConditionParser.parseSingleCondition("field=*value1*").description 
  must equalTo("field should contain value1"))

Scala does not have a "line continuation character" - it infers a semicolon always when:

  • An expression can end
  • The following (not whitespace) line begins not with a token that can start a statement
  • There are unclosed ( or [ found before

Thus, to "delay" semicolon inference one can place a method call or the dot at the end of the line or place the dot at the beginning of the following line:

ConditionParser.
parseSingleCondition("field=*value1*").
description must equalTo("field should contain value1")

a +
b +
c

List(1,2,3)
  .map(_+1)

Need Your Help

Cannot get a text value from a numeric cell “Poi”

java selenium-webdriver apache-poi

I'm trying to consume data from a spreadsheet in Excel, but always of this error, already tried formatting the worksheet to text and number and still the error persists.

codefirst - model changes commands

asp.net-mvc entity-framework ef-code-first

I am confused about one thing that how and in which order should we execute the commands in project manager console when a new model and modify the existing model requires to update the database.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.