mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
* fixes #10838 * reject func in types instead * trigger tests
This commit is contained in:
14
tests/proc/tfunc_type.nim
Normal file
14
tests/proc/tfunc_type.nim
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
discard """
|
||||
errmsg: "func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead"
|
||||
"""
|
||||
|
||||
type
|
||||
MyObject = object
|
||||
fn: func(a: int): int
|
||||
|
||||
proc myproc(a: int): int =
|
||||
echo "bla"
|
||||
result = a
|
||||
|
||||
var x = MyObject(fn: myproc)
|
||||
Reference in New Issue
Block a user