From f8a2aec6583f4a16dc062f5597fd1f6ed2d834a3 Mon Sep 17 00:00:00 2001 From: flywind Date: Mon, 17 Jan 2022 21:42:18 +0800 Subject: [PATCH 1/3] fix stricteffects (nimsuggest/sexp) --- nimsuggest/sexp.nim | 2 +- tests/effects/tstrict_effects3.nim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nimsuggest/sexp.nim b/nimsuggest/sexp.nim index cee538b6e273..31f4988e1274 100644 --- a/nimsuggest/sexp.nim +++ b/nimsuggest/sexp.nim @@ -409,7 +409,7 @@ macro convertSexp*(x: untyped): untyped = ## `%` for every element. result = toSexp(x) -proc `==`* (a,b: SexpNode): bool = +proc `==`* (a, b: SexpNode): bool {.noSideEffect.} = ## Check two nodes for equality if a.isNil: if b.isNil: return true diff --git a/tests/effects/tstrict_effects3.nim b/tests/effects/tstrict_effects3.nim index 4cc46154940b..aa3adf924e92 100644 --- a/tests/effects/tstrict_effects3.nim +++ b/tests/effects/tstrict_effects3.nim @@ -6,6 +6,8 @@ discard """ {.experimental: "strictEffects".} +import nimsuggest/sexp + proc fn(a: int, p1, p2: proc()) {.effectsOf: p1.} = if a == 7: p1() From f1fbe014fc68d925251e0f6cef6f0b0b705689e1 Mon Sep 17 00:00:00 2001 From: flywind Date: Mon, 17 Jan 2022 22:23:43 +0800 Subject: [PATCH 2/3] Update tstrict_effects3.nim --- tests/effects/tstrict_effects3.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/effects/tstrict_effects3.nim b/tests/effects/tstrict_effects3.nim index aa3adf924e92..7d531d640378 100644 --- a/tests/effects/tstrict_effects3.nim +++ b/tests/effects/tstrict_effects3.nim @@ -6,7 +6,6 @@ discard """ {.experimental: "strictEffects".} -import nimsuggest/sexp proc fn(a: int, p1, p2: proc()) {.effectsOf: p1.} = if a == 7: From a7b5134646aa8ad169b5cc47111f3aaf9392638e Mon Sep 17 00:00:00 2001 From: flywind Date: Mon, 17 Jan 2022 22:23:56 +0800 Subject: [PATCH 3/3] Update tests/effects/tstrict_effects3.nim --- tests/effects/tstrict_effects3.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/effects/tstrict_effects3.nim b/tests/effects/tstrict_effects3.nim index 7d531d640378..4cc46154940b 100644 --- a/tests/effects/tstrict_effects3.nim +++ b/tests/effects/tstrict_effects3.nim @@ -6,7 +6,6 @@ discard """ {.experimental: "strictEffects".} - proc fn(a: int, p1, p2: proc()) {.effectsOf: p1.} = if a == 7: p1()