score:2
Accepted answer
You're trying to mix two different, and conflicting, convenience syntax options.
instance.method(argument)
... can be expressed as ...
instance method argument
... and, if the method()
takes no argument then that can also be expressed with spaces, but the parser needs a little help.
instance method;
On a separate track, if the instance
is this
then that can be dropped.
method(argument)
But you can't drop the parentheses because the parser tries to interpret that as instance method
and fails.
Source: stackoverflow.com
Related Query
- Scala call single parameter method using space in anonymous class body
- Using type parameter in anonymous class in Scala
- How to call the object method (not class method) using reflection in scala
- Type mismatch when using Scala case class constructor as a method call
- How do I call a Scala Object method using reflection?
- How to pass a class method as a parameter in Scala
- Select certain super class for method call in Scala
- Method call with option value or default parameter in Scala
- Meaning of the Symbol of single apostrophe(') in Scala using Anonymous function under withColumn function?
- Why can I call += with a single parameter on a Scala Set?
- How to call java method taking parameter as List<Class<?>> from Scala
- Getting method parameter types using scala 2.10 reflection API
- Scala implicit parameter null when implicit val defined after method call
- Scala compiler error due to constructor parameter (property) having same name in both base and derived class and used in derived method
- Why does wrapping a method in another method stop type mismatch in Scala - using underscore in type parameter in pattern match?
- How to declare anonymous mixin using a type parameter in Scala
- Error passing generic values to method using implicit parameter in Scala
- Clarification on why I cannot override a method using a generic class parameter by a subtype of it
- Scala Class Variable Name Hides Method Parameter Name
- Is it possible to call a scala method passed as a parameter in a Java method?
- Scala compiler says my method is recursive in case when implicits and anonymous class is used
- call stored procedure oracle parameter array using scala / java
- Scala 2 Append A Method To Class Body (Metaprogramming)
- is a method parameter implicit? - using scala 2.10 reflection
- How to bind a class that extends a Trait with a monadic type parameter using Scala Guice?
- Is Scala ExecutionContext as Class or Method parameter more idiomatic?
- Scala syntax: why is anonymous function parameter type parsed differently using parenthesis versus curly braces?
- Using class field in lambda as parameter Scala
- Why can't I call a method with parameter `this` in a class extending a generic trait?
- How to call a function on an object with a generic type parameter using scala macros?
More Query from same tag
- Getting sub-scores for sub-queries in Lucene
- Explain this behaviour of scala class
- Type matching on generic Scala trait
- Playframework [Scala]: Binding a list/seq to the controller
- How to change the naming structure of the dependent libraries in the zip produced by sbt-native-packager?
- Compare two dataframes to find substring in spark
- Introducing termination as a precondition in Stainless
- How to join in spark graphx given multiple vertex types
- How to create test fixtures for every example of a functional test
- Scala play internationalization: how to set an explicit language across all templates
- functor syntax `map` for function does not work?
- Scala Currying Functions vs. Basic Functions Explained
- How to compare two dataframe and print columns that are different in scala
- Spray dependencies error
- Apache Spark: How do I convert a Spark DataFrame to a RDD with type RDD[(Type1,Type2, ...)]?
- How to implement enums in scala slick 3?
- How to convert List to ListBuffer?
- Scalding, can't use more than one trait in Job
- Akka supervisor actor do not handle exception when child actor throws an exception within onFailure of a future
- Using permutations causes: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
- Get arguments from a scala exception
- Monads as Monoids in practice
- How can I generate hash codes with Scala
- scala syntax understanding about loop and receive in actor
- Byte array to String and back.. issues with -127
- How do I explode a nested Struct in Spark using Scala
- How can I add new methods to a library object?
- Efficient way to concatenate hundreds of RxScala Observables (each with millions of events to emit)?
- What's the use and meaning of second type parameter in akka.Source
- When is case syntactically significant?