summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sigmatch.nim')
-rwxr-xr-xcompiler/sigmatch.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 7e482b3d2..82a8c9399 100755
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -282,7 +282,12 @@ proc matchTypeClass(c: var TCandidate, typeClass, t: PType): TTypeRelation =
   # if the loop finished without returning, either all constraints matched
   # or none of them matched.
   result = if tfAny in typeClass.flags: isNone else: isGeneric
-  
+
+proc matchTypeClass*(typeClass, typ: PType): bool =
+  var c: TCandidate
+  InitCandidate(c, typeClass)
+  result = matchTypeClass(c, typeClass, typ) == isGeneric
+
 proc procTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
   proc inconsistentVarTypes(f, a: PType): bool {.inline.} =
     result = f.kind != a.kind and (f.kind == tyVar or a.kind == tyVar)