make tests green again

This commit is contained in:
Araq 2017-12-01 10:18:49 +01:00
commit 96b7c2481c
2 changed files with 42 additions and 40 deletions

View file

@ -238,7 +238,6 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
# leave the op head symbol empty, # leave the op head symbol empty,
# we are going to try multiple variants # we are going to try multiple variants
errors = nil
n.sons[0..1] = [nil, n[1], f] n.sons[0..1] = [nil, n[1], f]
orig.sons[0..1] = [nil, orig[1], f] orig.sons[0..1] = [nil, orig[1], f]
@ -255,7 +254,6 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
tryOp "." tryOp "."
elif nfDotSetter in n.flags and f.kind == nkIdent and n.len == 3: elif nfDotSetter in n.flags and f.kind == nkIdent and n.len == 3:
errors = nil
# we need to strip away the trailing '=' here: # we need to strip away the trailing '=' here:
let calleeName = newIdentNode(getIdent(f.ident.s[0..f.ident.s.len-2]), n.info) let calleeName = newIdentNode(getIdent(f.ident.s[0..f.ident.s.len-2]), n.info)
let callOp = newIdentNode(getIdent".=", n.info) let callOp = newIdentNode(getIdent".=", n.info)

View file

@ -1,62 +1,66 @@
discard """ discard """
cmd: "nim c --verbosity:0 --colors:off $file" cmd: "nim c --verbosity:0 --colors:off $file"
nimout: ''' nimout: '''
texplain.nim(99, 10) Hint: Non-matching candidates for e(y) texplain.nim(103, 10) Hint: Non-matching candidates for e(y)
proc e(i: int): int proc e(i: int): int
texplain.nim(102, 7) Hint: Non-matching candidates for e(10) texplain.nim(106, 7) Hint: Non-matching candidates for e(10)
proc e(o: ExplainedConcept): int proc e(o: ExplainedConcept): int
texplain.nim(65, 6) ExplainedConcept: undeclared field: 'foo' texplain.nim(69, 6) ExplainedConcept: undeclared field: 'foo'
texplain.nim(65, 6) ExplainedConcept: undeclared field: '.' texplain.nim(69, 6) ExplainedConcept: undeclared field: '.'
texplain.nim(65, 6) ExplainedConcept: expression '.' cannot be called texplain.nim(69, 6) ExplainedConcept: expression '.' cannot be called
texplain.nim(65, 5) ExplainedConcept: concept predicate failed texplain.nim(69, 5) ExplainedConcept: concept predicate failed
texplain.nim(66, 6) ExplainedConcept: undeclared field: 'bar' texplain.nim(70, 6) ExplainedConcept: undeclared field: 'bar'
texplain.nim(66, 6) ExplainedConcept: undeclared field: '.' texplain.nim(70, 6) ExplainedConcept: undeclared field: '.'
texplain.nim(66, 6) ExplainedConcept: expression '.' cannot be called texplain.nim(70, 6) ExplainedConcept: expression '.' cannot be called
texplain.nim(65, 5) ExplainedConcept: concept predicate failed texplain.nim(69, 5) ExplainedConcept: concept predicate failed
texplain.nim(105, 10) Hint: Non-matching candidates for e(10) texplain.nim(109, 10) Hint: Non-matching candidates for e(10)
proc e(o: ExplainedConcept): int proc e(o: ExplainedConcept): int
texplain.nim(65, 6) ExplainedConcept: undeclared field: 'foo' texplain.nim(69, 6) ExplainedConcept: undeclared field: 'foo'
texplain.nim(65, 6) ExplainedConcept: undeclared field: '.' texplain.nim(69, 6) ExplainedConcept: undeclared field: '.'
texplain.nim(65, 6) ExplainedConcept: expression '.' cannot be called texplain.nim(69, 6) ExplainedConcept: expression '.' cannot be called
texplain.nim(65, 5) ExplainedConcept: concept predicate failed texplain.nim(69, 5) ExplainedConcept: concept predicate failed
texplain.nim(66, 6) ExplainedConcept: undeclared field: 'bar' texplain.nim(70, 6) ExplainedConcept: undeclared field: 'bar'
texplain.nim(66, 6) ExplainedConcept: undeclared field: '.' texplain.nim(70, 6) ExplainedConcept: undeclared field: '.'
texplain.nim(66, 6) ExplainedConcept: expression '.' cannot be called texplain.nim(70, 6) ExplainedConcept: expression '.' cannot be called
texplain.nim(65, 5) ExplainedConcept: concept predicate failed texplain.nim(69, 5) ExplainedConcept: concept predicate failed
texplain.nim(109, 20) Error: type mismatch: got (NonMatchingType) texplain.nim(113, 20) Error: type mismatch: got (NonMatchingType)
but expected one of: but expected one of:
proc e(o: ExplainedConcept): int proc e(o: ExplainedConcept): int
texplain.nim(65, 5) ExplainedConcept: concept predicate failed texplain.nim(69, 5) ExplainedConcept: concept predicate failed
proc e(i: int): int proc e(i: int): int
texplain.nim(110, 20) Error: type mismatch: got (NonMatchingType) expression: e(n)
texplain.nim(114, 20) Error: type mismatch: got (NonMatchingType)
but expected one of: but expected one of:
proc r(o: RegularConcept): int proc r(o: RegularConcept): int
texplain.nim(69, 5) RegularConcept: concept predicate failed texplain.nim(73, 5) RegularConcept: concept predicate failed
proc r[T](a: SomeNumber; b: T; c: auto) proc r[T](a: SomeNumber; b: T; c: auto)
proc r(i: string): int proc r(i: string): int
texplain.nim(111, 20) Hint: Non-matching candidates for r(y) expression: r(n)
texplain.nim(115, 20) Hint: Non-matching candidates for r(y)
proc r[T](a: SomeNumber; b: T; c: auto) proc r[T](a: SomeNumber; b: T; c: auto)
proc r(i: string): int proc r(i: string): int
texplain.nim(119, 2) Error: type mismatch: got (MatchingType) texplain.nim(123, 2) Error: type mismatch: got (MatchingType)
but expected one of: but expected one of:
proc f(o: NestedConcept) proc f(o: NestedConcept)
texplain.nim(69, 6) RegularConcept: undeclared field: 'foo' texplain.nim(73, 6) RegularConcept: undeclared field: 'foo'
texplain.nim(69, 6) RegularConcept: undeclared field: '.' texplain.nim(73, 6) RegularConcept: undeclared field: '.'
texplain.nim(69, 6) RegularConcept: expression '.' cannot be called texplain.nim(73, 6) RegularConcept: expression '.' cannot be called
texplain.nim(69, 5) RegularConcept: concept predicate failed texplain.nim(73, 5) RegularConcept: concept predicate failed
texplain.nim(70, 6) RegularConcept: undeclared field: 'bar' texplain.nim(74, 6) RegularConcept: undeclared field: 'bar'
texplain.nim(70, 6) RegularConcept: undeclared field: '.' texplain.nim(74, 6) RegularConcept: undeclared field: '.'
texplain.nim(70, 6) RegularConcept: expression '.' cannot be called texplain.nim(74, 6) RegularConcept: expression '.' cannot be called
texplain.nim(69, 5) RegularConcept: concept predicate failed texplain.nim(73, 5) RegularConcept: concept predicate failed
texplain.nim(73, 5) NestedConcept: concept predicate failed texplain.nim(77, 5) NestedConcept: concept predicate failed
expression: f(y)
''' '''
line: 119 line: 123
errormsg: "type mismatch: got (MatchingType)" errormsg: "type mismatch: got (MatchingType)"
""" """