From d5c5fd425f0dbbfddd35a7fff27f377cd9392903 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 8 Sep 2015 20:32:40 +0200 Subject: [PATCH] fixes #3230 --- compiler/semfold.nim | 2 +- tests/typerel/typeof_in_template.nim | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/typerel/typeof_in_template.nim diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 2ab43a9c93..70276a6d41 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -435,7 +435,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = mAppendStrStr, mAppendSeqElem, mSetLengthStr, mSetLengthSeq, mParseExprToAst, mParseStmtToAst, mExpandToAst, mTypeTrait, mDotDot, mNLen..mNError, mEqRef, mSlurp, mStaticExec, mNGenSym, mSpawn, - mParallel, mPlugin, mGetTypeInfo: + mParallel, mPlugin, mGetTypeInfo, mTypeOf: discard of mEqProc: result = newIntNodeT(ord( diff --git a/tests/typerel/typeof_in_template.nim b/tests/typerel/typeof_in_template.nim new file mode 100644 index 0000000000..9ec06f2e31 --- /dev/null +++ b/tests/typerel/typeof_in_template.nim @@ -0,0 +1,16 @@ +discard """ + output: '''@[a, c]''' +""" + +# bug #3230 + +import sequtils + +const + test_strings = ["a", "b", "c"] + +proc is_doc(x: string): bool = x == "b" + +let + tests = @test_strings.filter_it(not it.is_doc) +echo tests