make tests green again
This commit is contained in:
parent
4846e4e452
commit
a08fb61da9
3 changed files with 15 additions and 7 deletions
|
|
@ -1085,9 +1085,11 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
if ty.n != nil and ty.n.kind == nkRecList:
|
if ty.n != nil and ty.n.kind == nkRecList:
|
||||||
let field = lookupInRecord(ty.n, i)
|
let field = lookupInRecord(ty.n, i)
|
||||||
if field != nil:
|
if field != nil:
|
||||||
n.typ = newTypeWithSons(c, tyFieldAccessor, @[ty, field.typ])
|
n.typ = makeTypeDesc(c, field.typ)
|
||||||
n.typ.n = copyTree(n)
|
|
||||||
return n
|
return n
|
||||||
|
#n.typ = newTypeWithSons(c, tyFieldAccessor, @[ty, field.typ])
|
||||||
|
#n.typ.n = copyTree(n)
|
||||||
|
#return n
|
||||||
else:
|
else:
|
||||||
tryReadingGenericParam(ty)
|
tryReadingGenericParam(ty)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -261,11 +261,17 @@ proc high*[T: Ordinal](x: T): T {.magic: "High", noSideEffect.}
|
||||||
proc high*[T: Ordinal](x: typeDesc[T]): T {.magic: "High", noSideEffect.}
|
proc high*[T: Ordinal](x: typeDesc[T]): T {.magic: "High", noSideEffect.}
|
||||||
proc high*[T](x: openArray[T]): int {.magic: "High", noSideEffect.}
|
proc high*[T](x: openArray[T]): int {.magic: "High", noSideEffect.}
|
||||||
proc high*[I, T](x: array[I, T]): I {.magic: "High", noSideEffect.}
|
proc high*[I, T](x: array[I, T]): I {.magic: "High", noSideEffect.}
|
||||||
|
proc high*[I, T](x: typeDesc[array[I, T]]): I {.magic: "High", noSideEffect.}
|
||||||
|
proc high*(x: cstring): int {.magic: "High", noSideEffect.}
|
||||||
|
proc high*(x: string): int {.magic: "High", noSideEffect.}
|
||||||
|
|
||||||
proc low*[T: Ordinal](x: typeDesc[T]): T {.magic: "Low", noSideEffect.}
|
proc low*[T: Ordinal](x: typeDesc[T]): T {.magic: "Low", noSideEffect.}
|
||||||
proc low*[T](x: openArray[T]): int {.magic: "Low", noSideEffect.}
|
proc low*[T](x: openArray[T]): int {.magic: "Low", noSideEffect.}
|
||||||
proc low*[I, T](x: array[I, T]): I {.magic: "Low", noSideEffect.}
|
proc low*[I, T](x: array[I, T]): I {.magic: "Low", noSideEffect.}
|
||||||
proc low*[T](x: T): T {.magic: "Low", noSideEffect.}
|
proc low*[T](x: T): T {.magic: "Low", noSideEffect.}
|
||||||
|
proc low*[I, T](x: typeDesc[array[I, T]]): I {.magic: "Low", noSideEffect.}
|
||||||
|
proc low*(x: cstring): int {.magic: "Low", noSideEffect.}
|
||||||
|
proc low*(x: string): int {.magic: "Low", noSideEffect.}
|
||||||
## returns the lowest possible index of an array, a sequence, a string or
|
## returns the lowest possible index of an array, a sequence, a string or
|
||||||
## the lowest possible value of an ordinal value `x`. As a special
|
## the lowest possible value of an ordinal value `x`. As a special
|
||||||
## semantic rule, `x` may also be a type identifier.
|
## semantic rule, `x` may also be a type identifier.
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ t3330.nim(40, 4) Error: type mismatch: got (Bar[system.int])
|
||||||
but expected one of:
|
but expected one of:
|
||||||
proc test(foo: Foo[int])
|
proc test(foo: Foo[int])
|
||||||
t3330.nim(25, 8) Hint: Non-matching candidates for add(k, string, T)
|
t3330.nim(25, 8) Hint: Non-matching candidates for add(k, string, T)
|
||||||
proc add[T](x: var seq[T]; y: T)
|
|
||||||
proc add(result: var string; x: float)
|
|
||||||
proc add(x: var string; y: string)
|
proc add(x: var string; y: string)
|
||||||
proc add(x: var string; y: cstring)
|
|
||||||
proc add(x: var string; y: char)
|
proc add(x: var string; y: char)
|
||||||
proc add(result: var string; x: int64)
|
proc add(result: var string; x: int64)
|
||||||
|
proc add(x: var string; y: cstring)
|
||||||
|
proc add(result: var string; x: float)
|
||||||
proc add[T](x: var seq[T]; y: openArray[T])
|
proc add[T](x: var seq[T]; y: openArray[T])
|
||||||
|
proc add[T](x: var seq[T]; y: T)
|
||||||
|
|
||||||
t3330.nim(25, 8) template/generic instantiation from here
|
t3330.nim(25, 8) template/generic instantiation from here
|
||||||
t3330.nim(32, 6) Foo: 'bar.value' cannot be assigned to
|
t3330.nim(32, 6) Foo: 'bar.value' cannot be assigned to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue