Make all types support "!" so "if (!foo)" works reliably for all objects.
This commit is contained in:
@@ -1 +1 @@
|
||||
[1, 2, 3].all {|x| "string" } // expect runtime error: String does not implement method '!' with 0 arguments.
|
||||
IO.print([1, 2, 3].all {|x| "truthy" }) // expect: true
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
IO.print(![1, 2]) // expect: false
|
||||
IO.print(![]) // expect: false
|
||||
Reference in New Issue
Block a user