fix broken => for typed procs with pragmas (#16190)

* fix broken => for typed procs with pragmas

* add more sugar tests

* add ending quote
This commit is contained in:
hlaaftana 2020-12-01 14:01:36 +03:00 • committed by GitHub
commit 1d1b3f79fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

View file

@ -71,3 +71,16 @@ m:
echo "yes"
sugarWithPragma() {.m.} => echo "sugarWithPragma called"
typedParamAndPragma(x, y: int) {.used.} -> int => x + y
doAssert typedParamAndPragma(1, 2) == 3
type
Bot = object
call: proc (): string {.noSideEffect.}
var myBot = Bot()
myBot.call = () {.noSideEffect.} => "I'm a bot."
doAssert myBot.call() == "I'm a bot."