summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 049c9520b..433455365 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1046,12 +1046,13 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType,
       # put(m.bindings, f, argType)
       return argSemantized
 
-    var evaluated = c.semTryConstExpr(c, arg)
-    if evaluated != nil:
-      arg.typ = newTypeS(tyStatic, c)
-      arg.typ.sons = @[evaluated.typ]
-      arg.typ.n = evaluated
-      argType = arg.typ
+    if argType.kind != tyStatic:
+      var evaluated = c.semTryConstExpr(c, arg)
+      if evaluated != nil:
+        arg.typ = newTypeS(tyStatic, c)
+        arg.typ.sons = @[evaluated.typ]
+        arg.typ.n = evaluated
+        argType = arg.typ
  
   var
     a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc, tyFieldAccessor})