introduce a pre-processing pass for the concept bodies
fixes #4982 fixes #3805 close #3414
This commit is contained in:
parent
30ccadfe4c
commit
cd02561368
13 changed files with 138 additions and 60 deletions
18
tests/concepts/t4982.nim
Normal file
18
tests/concepts/t4982.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
errormsg: "undeclared identifier: 'x'"
|
||||
line: 10
|
||||
"""
|
||||
|
||||
import typetraits # without this import the program compiles (and echos false)
|
||||
|
||||
type
|
||||
SomeTestConcept = concept t
|
||||
x.name is string # typo: t.name was intended (which would result in echo true)
|
||||
|
||||
type
|
||||
TestClass = ref object of RootObj
|
||||
name: string
|
||||
|
||||
var test = TestClass(name: "mytest")
|
||||
echo $(test is SomeTestConcept)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue