introduce a pre-processing pass for the concept bodies

fixes #4982
fixes #3805

close #3414
This commit is contained in:
Zahary Karadjov 2017-06-05 05:20:13 +03:00 • committed by Andreas Rumpf
commit cd02561368
13 changed files with 138 additions and 60 deletions

18
tests/concepts/t4982.nim Normal file
View 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)