summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-10-01 08:53:35 +0200
committerGitHub <noreply@github.com>2018-10-01 08:53:35 +0200
commit3d60f1b0af6fc3d8d9446a87bd26ff054562fa20 (patch)
tree61fd6089fe9e4ff03bce388e635777a1d0b0b1cc /compiler
parent5676e032bda9d86232b003797bdb67070af43e28 (diff)
parent6d4503325cc667dcfd18c53cee6ef0d245d9f870 (diff)
downloadNim-3d60f1b0af6fc3d8d9446a87bd26ff054562fa20.tar.gz
Merge pull request #9131 from LemonBoy/fix-9130
Fix regression with runnableExamples in generic expr
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semgnrc.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index 7be0610a2..e1a8390e1 100644
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -225,7 +225,7 @@ proc semGenericStmt(c: PContext, n: PNode,
     var mixinContext = false
     if s != nil:
       incl(s.flags, sfUsed)
-      mixinContext = s.magic in {mDefined, mDefinedInScope, mCompiles, mRunnableExamples}
+      mixinContext = s.magic in {mDefined, mDefinedInScope, mCompiles}
       let sc = symChoice(c, fn, s, if s.isMixedIn: scForceOpen else: scOpen)
       case s.kind
       of skMacro:
@@ -255,11 +255,11 @@ proc semGenericStmt(c: PContext, n: PNode,
         discard
       of skProc, skFunc, skMethod, skIterator, skConverter, skModule:
         result.sons[0] = sc
-        # do not check of 's.magic==mRoof' here because it might be some
-        # other '^' but after overload resolution the proper one:
-        if ctx.bracketExpr != nil and n.len == 2 and s.name.s == "^":
-          result.add ctx.bracketExpr
         first = 1
+        # We're not interested in the example code during this pass so let's
+        # skip it
+        if s.magic == mRunnableExamples:
+          inc first
       of skGenericParam:
         result.sons[0] = newSymNodeTypeDesc(s, fn.info)
         styleCheckUse(fn.info, s)
ous revision' href='/akkartik/mu/blame/html/subx/examples/ex4.subx.html?h=hlt&id=044b4130214f9dbe0d9d9990a3b9c3fa2f0a1e45'>^
bb2b6ba7 ^
































e4ac3c9e ^
bb2b6ba7 ^
14a38052 ^
c56d803c ^

ebd35521 ^

bb2b6ba7 ^
c762564b ^
d1c9392a ^
c56d803c ^
14a38052 ^
d1c9392a ^
14a38052 ^
08a0eed6 ^
14a38052 ^
d1c9392a ^
14a38052 ^
d1c9392a ^


c56d803c ^
14a38052 ^
d1c9392a ^
14a38052 ^
08a0eed6 ^
14a38052 ^
d1c9392a ^
14a38052 ^
d1c9392a ^


c56d803c ^
d1c9392a ^




901ae474 ^
e99038ea ^
d1c9392a ^
14a38052 ^
bb2b6ba7 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100