summary refs log tree commit diff stats
path: root/tests/iter/titerautoerr1.nim
Commit message (Expand)AuthorAgeFilesLines
* Iterator fixes (#11234)Jasper Jenkins2019-05-131-0/+8
='#n21'>21 22 23 24 25 26 27 28 29 30 31
discard """
  cmd: "nim cpp $file"
"""

{.emit: """

namespace System {
  struct Input {};
}

struct SystemManager {
  template <class T>
  static T* getSubsystem() { return new T; }
};

""".}

type Input {.importcpp: "System::Input".} = object
proc getSubsystem*[T](): ptr T {.
  importcpp: "SystemManager::getSubsystem<'*0>()", nodecl.}

let input: ptr Input = getSubsystem[Input]()


# bug #4910

proc foo() =
  var ts: array[10, int]
  for t in mitems(ts):
     t = 123