Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 4 years ago

Language

Nim

Compiler

nim 1.4.6

Options

Author

anonymous

about 4 years ago

test.nim

$ nim c ./prog.nim
Hint: used config file '/opt/wandbox/nim-1.4.6/config/nim.cfg' [Conf]
Hint: used config file '/opt/wandbox/nim-1.4.6/config/config.nims' [Conf]
....
/home/jail/prog.nim(3, 10) Error: type mismatch: got <iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}>
but expected one of: 
iterator items(E: typedesc[enum]): E:type
  first type mismatch at position: 1
  required type for E: type enum
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items(a: cstring): char
  first type mismatch at position: 1
  required type for a: cstring
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items(a: string): char
  first type mismatch at position: 1
  required type for a: string
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[IX, T](a: array[IX, T]): T
  first type mismatch at position: 1
  required type for a: array[IX, T]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[T: char](a: openArray[T]): T
  first type mismatch at position: 1
  required type for a: openArray[T: char]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[T: not char](a: openArray[T]): lent2 T
  first type mismatch at position: 1
  required type for a: openArray[T: not char]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[T](a: seq[T]): lent2 T
  first type mismatch at position: 1
  required type for a: seq[T]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[T](a: set[T]): T
  first type mismatch at position: 1
  required type for a: set[T]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}
iterator items[T](s: HSlice[T, T]): T
  first type mismatch at position: 1
  required type for s: HSlice[items.T, items.T]
  but expression 'it' is of type: iterator (): int{.closure, noSideEffect, gcsafe, locks: 0.}

expression: items(it)
Exit Code:
1