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:
parent
2e4b6b94e6
commit
1d1b3f79fd
2 changed files with 19 additions and 9 deletions
|
|
@ -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."
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue