Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Oct 16, 2022
1 parent 3f14fde commit cf2a7b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 31 deletions.
4 changes: 2 additions & 2 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
if r == isGeneric:
inc(m.genericMatches, 2)
else:
inc(m.typeClassMatches)
inc(m.typeClassMatches, 2)
if arg.typ == nil:
result = arg
elif skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple or
Expand Down Expand Up @@ -2181,7 +2181,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
params = nkFormalParams.newTree(p.emptyNode), name = p.emptyNode, pattern = p.emptyNode,
genericParams = p.emptyNode, pragmas = p.emptyNode, exceptions = p.emptyNode), {})
if f.kind == tyBuiltInTypeClass:
inc m.genericMatches, 2
inc m.typeClassMatches, 2
put(m, f, lifted.typ)
inc m.convMatches
return implicitConv(nkHiddenStdConv, f, lifted, m, c)
Expand Down
10 changes: 5 additions & 5 deletions lib/pure/json.nim
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ proc `[]=`*(obj: JsonNode, key: string, val: JsonNode) {.inline.} =
assert(obj.kind == JObject)
obj.fields[key] = val

proc `%`*(o: enum): JsonNode =
## Construct a JsonNode that represents the specified enum value as a
## string. Creates a new `JString JsonNode`.
result = %($o)

proc `%`*[T: object](o: T): JsonNode =
## Construct JsonNode from tuples and objects.
result = newJObject()
Expand All @@ -402,11 +407,6 @@ proc `%`*(o: ref object): JsonNode =
else:
result = %(o[])

proc `%`*(o: enum): JsonNode =
## Construct a JsonNode that represents the specified enum value as a
## string. Creates a new `JString JsonNode`.
result = %($o)

proc toJsonImpl(x: NimNode): NimNode =
case x.kind
of nnkBracket: # array
Expand Down
23 changes: 0 additions & 23 deletions tests/generics/t6840.nim

This file was deleted.

2 changes: 1 addition & 1 deletion tests/stdlib/tstrformat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ proc main() =
let data1 = [1'i64, 10000'i64, 10000000'i64]
let data2 = [10000000'i64, 100'i64, 1'i64]

proc formatValue[T: array|seq|openArray](result: var string; value: T; specifier: string) =
proc formatValue(result: var string; value: (array|seq|openArray); specifier: string) =
result.add "["
for i, it in value:
if i != 0:
Expand Down

0 comments on commit cf2a7b8

Please sign in to comment.