strict effects (#18777)

* fixes #17369
* megatest is green for --cpu:arm64
* docgen output includes more tags/raises
* implemented 'effectsOf' 
* algorithm.nim: uses new effectsOf annotation
* closes #18376
* closes #17475
* closes #13905
* allow effectsOf: [a, b]
* added a test case
* parameters that are not ours cannot be declared as .effectsOf
* documentation
* manual: added the 'sort' example
* bootstrap with the new better options
This commit is contained in:
Andreas Rumpf 2021-09-02 12:10:14 +02:00 • committed by GitHub
commit e0ef859130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 482 additions and 203 deletions

View file

@ -20,12 +20,6 @@ Hi Andreas! How do you feel, Rumpf?
@[0, 2, 1]
@[0, 1, 2]
055this should be the casehugh@["(", "+", " 1", " 2", ")"]
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
[5]
[4, 5]
[3, 4, 5]
@ -161,18 +155,21 @@ block tropes:
block tsegfaults:
proc main =
try:
var x: ptr int
echo x[]
when not defined(arm64):
var crashes = 0
proc main =
try:
raise newException(ValueError, "not a crash")
except ValueError:
discard
except NilAccessDefect:
echo "caught a crash!"
for i in 0..5:
main()
var x: ptr int
echo x[]
try:
raise newException(ValueError, "not a crash")
except ValueError:
discard
except NilAccessDefect:
inc crashes
for i in 0..5:
main()
assert crashes == 6