summary refs log tree commit diff stats
path: root/doc/basicopt.txt
Commit message (Expand)AuthorAgeFilesLines
* new: `nim -e:cmd` to run a command directly; also fixes #15731 (#15687)Timothee Cour2020-11-091-0/+3
* fix the indentation in `--help` and `--fullhelp` (#15387)Miran2020-09-231-5/+5
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, `--d...Timothee Cour2020-05-111-2/+4
* new cmd: `nim r main [args...]` to compile & run, saving binary under $nimcac...Timothee Cour2020-04-231-0/+1
* Fixes #11431 (#11451) [bugfix]Juan Carlos2019-06-101-1/+1
* doc: move specific checks to advanced options, for a less intimidatin… (#10...Jacek Sieka2019-03-041-9/+2
* compiler interface: don't overdocument the on|off switchesAraq2019-01-221-1/+1
* fix #9629 every binary cmd line option allows on/off/empty=on (#10353)Timothee Cour2019-01-181-2/+2
* better doc for hard to find --define:SYMBOL:VAL (#8257)Timothee Cour2018-07-111-1/+2
* remove dead code elimination option (#7669)Jacek Sieka2018-04-231-1/+0
* replace --advanced by --fullhelp; refs #7621Andreas Rumpf2018-04-201-1/+1
* 'nim doc' is now using version 2 of the documentation generatorAndreas Rumpf2017-11-161-1/+0
* Add missing nilChecks compiling option (#6480)Eduardo Bart2017-10-091-0/+1
* new dependency tracking for nimsuggestAraq2016-11-051-1/+1
* Update documentation and newsJeff Ciesielski2016-07-051-1/+2
* Add the ability to pass a value with the -d flagJeff Ciesielski2016-07-041-1/+2
* fixes #1868Araq2015-03-121-0/+1
* improved --debugger switch; updated release planAraq2015-02-271-1/+1
* tables work in 'const' sections; echo supports 'nil' strings; minor cleanupsAraq2015-02-091-1/+0
* clarify single letter option requirementsJoseph Poirier2015-01-021-1/+1
* Fix paragraph break issue in nimc.txt. Add spacing to command line options ta...Nick Greenfield2014-12-211-2/+3
* merged things from develAraq2014-09-121-0/+2
|\
| * be explicit about single letter optionsAraq2014-09-111-0/+2
* | Nimrod renamed to NimAraq2014-08-281-2/+2
|/
* distinguish between 'defined' and 'declared'Araq2014-08-111-0/+1
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
* doc2 improvementsAraq2012-06-241-1/+1
* New algorithm for locating and loading nimrod config files.Zahary Karadjov2011-11-251-1/+2
* --stdout support; idetools implementedAraq2011-02-251-6/+6
* REPL improvementsAraq2011-02-131-4/+2
* changes to threads; --recursivePath supportAraq2011-01-291-1/+1
* tiny C support; cosmetic improvements for the docsAraq2010-08-281-0/+37
color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
errormsg: "type mismatch: got (Bar[system.int])"
nimout: '''
t3330.nim(40, 4) Error: type mismatch: got (Bar[system.int])
but expected one of:
proc test(foo: Foo[int])
t3330.nim(25, 8) Hint: Non-matching candidates for add(k, string, T)
proc add(x: var string; y: string)
proc add(x: var string; y: char)
proc add(result: var string; x: int64)
proc add(result: var string; x: float)
proc add(x: var string; y: cstring)
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(32, 6) Foo: 'bar.value' cannot be assigned to
t3330.nim(25, 8) template/generic instantiation from here
t3330.nim(33, 6) Foo: 'bar.x' cannot be assigned to
'''
"""

type
  Foo[T] = concept k
    add(k, string, T)

  Bar[T] = object
    value: T
    x: string

proc add[T](bar: Bar[T], x: string, val: T) =
  bar.value = val
  bar.x = x

proc test(foo: Foo[int]) =
  foo.add("test", 42)
  echo(foo.x)

var bar = Bar[int]()
bar.test()