Remove support for named procs with sugar.=> (#17220)

* Add docs & tests for named procs with sugar.=>
* Remove support for named procs in sugar.=>
* Resolve conflict
* Fix test
This commit is contained in:
konsumlamm 2021-03-05 12:08:03 +01:00 • committed by GitHub
commit 2e8325a19c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 18 deletions

View file

@ -5,8 +5,6 @@ calling mystuff
yes
calling mystuff
yes
calling sugarWithPragma
sugarWithPragma called
'''
"""
@ -40,7 +38,7 @@ proc pass2(f: (int, int) -> int): (int) -> int =
doAssert pass2((x, y) => x + y)(4) == 6
fun(x, y: int) {.noSideEffect.} => x + y
const fun = (x, y: int) {.noSideEffect.} => x + y
doAssert typeof(fun) is (proc (x, y: int): int {.nimcall.})
doAssert fun(3, 4) == 7
@ -70,9 +68,7 @@ m:
proc mystuff() =
echo "yes"
sugarWithPragma() {.m.} => echo "sugarWithPragma called"
typedParamAndPragma(x, y: int) {.used.} -> int => x + y
const typedParamAndPragma = (x, y: int) -> int => x + y
doAssert typedParamAndPragma(1, 2) == 3
type
@ -82,5 +78,3 @@ type
var myBot = Bot()
myBot.call = () {.noSideEffect.} => "I'm a bot."
doAssert myBot.call() == "I'm a bot."