Infix Operators do NOT work if an object has a method that takes two parameters:
Here we create our own prefix operator for our own class.
Here we create our own prefix operator for our own class. The only identifiers that can be used as prefix operators are +
, -
, !
, and ~
:
Any method which does not require a parameter can be used as a postfix operator: a.m
can be written a m
.
Any method which does not require a parameter can be used as a postfix operator: a.m
can be written a m
.
For instance a.##(b)
can be written a ## b
and a.!
can be written a!
**Postfix operators** have lower precedence than **infix operators**, so:
- foo bar baz
means foo.bar(baz)
.
- foo bar baz bam
means (foo.bar(baz)).bam
- foo bar baz bam bim
means (foo.bar(baz)).bam(bim)
.
Any method which takes a single parameter can be used as an infix operator: a.m(b)
can be written a m b
.
Prefix operators work if an object has a method name that starts with unary_
:
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
Please use 'an [Exception] should be thrownBy { ... }' syntax instead
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.