File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -24,4 +24,18 @@ object DottyPredef {
24
24
* `discardForView` from two to one.
25
25
*/
26
26
abstract class ImplicitConverter [- T , + U ] extends Function1 [T , U ]
27
+
28
+ @ inline final def assert (assertion : Boolean , message : => Any ): Unit = {
29
+ if (! assertion)
30
+ assertFail(message)
31
+ }
32
+
33
+ @ inline final def assert (assertion : Boolean ): Unit = {
34
+ if (! assertion)
35
+ assertFail()
36
+ }
37
+
38
+ final def assertFail (): Unit = throw new java.lang.AssertionError (" assertion failed" )
39
+ final def assertFail (message : => Any ): Unit = throw new java.lang.AssertionError (" assertion failed: " + message)
40
+
27
41
}
Original file line number Diff line number Diff line change 1
1
import Predef .{assert => _ }
2
+ import dotty .DottyPredef .{assert => _ }
2
3
3
4
object Test {
4
5
assert(" asdf" == " asdf" ) // error: not found assert
You can’t perform that action at this time.
0 commit comments