From d94ee75d1cc4ce7caad014944f943cdfbae49715 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 22 Aug 2018 15:49:43 +0200 Subject: [PATCH] Pick skParam symbols when resolving type idents (#8720) Fixes #8357 --- compiler/semtypes.nim | 2 +- tests/proc/t8357.nim | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/proc/t8357.nim diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 0a1e14236..dd1e96bde 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -369,7 +369,7 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = if n.kind == nkSym: result = getGenSym(c, n.sym) else: - result = pickSym(c, n, {skType, skGenericParam}) + result = pickSym(c, n, {skType, skGenericParam, skParam}) if result.isNil: result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) if result != nil: diff --git a/tests/proc/t8357.nim b/tests/proc/t8357.nim new file mode 100644 index 000000000..350ebe356 --- /dev/null +++ b/tests/proc/t8357.nim @@ -0,0 +1,10 @@ +discard """ + output: "Hello" +""" + +type + T = ref int + +let r = new(string) +r[] = "Hello" +echo r[]