summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* Don't consider tyAnd/tyNot/tyOr/tyAnything as generic (#8700)LemonBoy2018-08-221-0/+5
| | | | | | | | | | | | | | | * Don't consider tyAnd/tyNot/tyOr/tyAnything as generic `containsGenericType` was too shallow and didn't check all the branches. The resulting half-processed nodes are often simplified by the constant folding pass but when that's not possible we get a nasty error during codegen. Fixes #8693 * Move the blame onto the semFold pass Slightly better evaluation of `is` forms.
* fixes #8425Araq2018-08-041-1/+1
|
* keep the imports in runnableExamples visible in generated html doc (#8354)skilchen2018-07-191-2/+3
|
* fix #7405 and #8195 (#8198)Timothee Cour2018-07-161-0/+3
| | | | | | | | * fix #7405 and #8195 * control pushInfoContext in semExprNoType,genStmts via a new hintExtendedContext; make NotesVerbosity computation more DRY * addressed comments
* enable destructors without the --newruntime switchAndreas Rumpf2018-07-041-6/+1
|
* Minor changes to discardable handling (#8155)LemonBoy2018-07-011-13/+0
|
* fix #8129 by calling `semExpr` in `semIs` if node is `strLit` (#8130)Vindaar2018-06-291-0/+2
| | | | | | | | | | | | | | | | | | | * call `semExpr` in `semIs` if node is `strLit`, fixes #8129 In case the second son of the node in `semIs` is of kind `strLit`, we now call `semExpr` to set the `typ` field of that node. Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the kind of `n[2]` is already assertet with the `internalAssert`. * reintroduce check for `t2.kind != tyTypeDesc` to fix test case The `internalAssert` in the `isOpImpl` doesn't check `n.sons[2].typ.kind` as I previously read, but rather `n.sons[2].kind`. Therefore the check for `tyTypeDesc` here is useful. Otherwise the last test case in `isopr.nim` fails. Also removes the flag `efDetermineType` from the call to `semExpr`.
* Merge branch 'devel' into typedesc-reformsAndreas Rumpf2018-06-261-2/+2
|\
| * More concept fixesLemonBoy2018-06-241-2/+2
| | | | | | | | Fixes #7705, #7703, #7702
* | requested pull-request changesZahary Karadjov2018-06-161-0/+1
| |
* | fix some breakage after rebasingZahary Karadjov2018-06-161-1/+1
| |
* | fixes #7222; fixes #5595; fixes #3747Zahary Karadjov2018-06-161-0/+30
| | | | | | | | | | | | | | | | | | | | * late instantiation for the generic procs' default param values * automatic mixin behaviour in concepts Other fixes: * don't render the automatically inserted default params in calls * better rendering of tyFromExpr
* | Implement the `is` operator for the new static and typedesc type classesZahary Karadjov2018-06-161-20/+61
| | | | | | | | | | | | | | | | | | This also makes the first baby steps towards a sound treatment of higher-order kinds (type type int). Adds test cases showcasing the new features. * Also fixes breakage after the rebase
* | A minimal patch enabling the new typedesc and static types syntaxZahary Karadjov2018-06-161-6/+33
|/
* implements a --nep1:on switch to make the compiler enforce the naming ↵Andreas Rumpf2018-06-131-1/+1
| | | | conventions outlined in NEP-1
* Fixes #6803Yuriy Glukhov2018-06-111-0/+3
|
* fixes yet another merge conflictAraq2018-06-111-2/+0
|\
| * Merge pull request #8009 from yglukhov/remove-oldIterTransfAndreas Rumpf2018-06-111-2/+0
| |\ | | | | | | Removed oldIterTranf feature
| | * Removed oldIterTranf featureYuriy Glukhov2018-06-101-2/+0
| | |
* | | fixes merge conflictAraq2018-06-111-4/+2
|\| |
| * | fix #7997Vindaar2018-06-101-4/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue #7997, which was caused by an export of a `release` proc in `locks`. Thus the `release` in `defined(release)` of the `ifDebug` template, was of kind `nkSym` instead of `nkIdent`. We fix this by getting the `PIdent` of the argument to `defined` using `considerQuotedIdent`. This has the nice property of also checking for a valid identifier for us. E.g. `defined(123)` would fail with ``` Error: in expression 'defined(123)': identifier expected, but found '123' ``` The `localError` is removed, due to a clear distinction between `declared` and `defined` now.
* | fixex merge conflictsAraq2018-06-081-1/+1
|\|
| * Merge branch 'devel' into yield-in-tryYuriy Glukhov2018-05-151-231/+238
| |\
| * | Yield in tryYuriy Glukhov2018-05-091-1/+1
| | |
* | | incremental compilation: implemented basic replay logicAndreas Rumpf2018-06-021-3/+3
| | |
* | | refactoring: remove idents.legacy global variable and pass the IdentCache ↵Andreas Rumpf2018-05-271-18/+18
| | | | | | | | | | | | around explicitly
* | | remove more global variables in the Nim compilerAndreas Rumpf2018-05-271-10/+10
| | |
* | | make semantic checking free of globalsAndreas Rumpf2018-05-181-2/+2
| | |
* | | platform.nim doesn't use globals anymore; prepare msgs.nim for not using globalsAndreas Rumpf2018-05-181-7/+7
| | |
* | | preparations of making compiler/msgs.nim free of global variablesAndreas Rumpf2018-05-171-1/+1
| | |
* | | remove ast.emptyNode global; cleanup configuration.nimAraq2018-05-161-13/+16
| |/ |/|
* | fixes testament compilationAraq2018-05-141-5/+28
|\|
| * implement the export/except statementZahary Karadjov2018-05-071-2/+21
| |
| * A motivating example for the new `bindSym` behavior.Zahary Karadjov2018-05-071-0/+2
| | | | | | | | | | | | | | | | The example is a proof-of-concept logging library, allowing you to define lexically-scoped environments where certain logging attributes are applied automatically to all logging statements. fixes tmacro1 (use of `bindSym` inside static blocks)
| * Better support for treating templates and macros as symbols.Zahary Karadjov2018-05-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to pass a template or a macro to another macro which can then inspect the implementation of the former template/macro using `getImpl`. Since templates can be freely redefined, this allows you to treat their symbols as compile-time variables that have lexical scope. A motivating PoC example for a logging library taking advantage of this will be provided in the next commit. Implementation details: * The name of a template or a macro will be consider a symbol if the template/macro requires parameters * For parameterless templates/macros, you can use `bindSym`, which was extended to also work outside of compile-time procs.
* | options.nim: no global variables anymoreAndreas Rumpf2018-05-131-6/+6
| |
* | make nimsuggest compile againAndreas Rumpf2018-05-131-1/+1
| |
* | sem pass compiles againAndreas Rumpf2018-05-121-144/+151
| |
* | semstmts compiles againAndreas Rumpf2018-05-121-3/+3
| |
* | more modules compile againAndreas Rumpf2018-05-121-107/+107
|/
* compiler refactoring, pass config around explicitlyAndreas Rumpf2018-05-051-3/+3
|
* minor speedup: concept tests still greenAndreas Rumpf2018-04-281-1/+2
|
* stuff that is greenAndreas Rumpf2018-04-281-1/+2
|
* semcheck: code cleanupsAndreas Rumpf2018-04-281-5/+1
|
* .experimental can now be used to enable specific featuresAndreas Rumpf2018-04-241-3/+3
|
* new 'var T' error messages with hyperlinks; closes #7373Andreas Rumpf2018-04-221-4/+4
|
* fixes #5113Andreas Rumpf2018-04-211-0/+8
|
* introduce nkTupleConstr AST node for unary tuple construction; breaking changeAndreas Rumpf2018-04-131-9/+11
|
* Static[T] fixes (#7333)zah2018-03-241-6/+34
| | | | | | | | | | | * fix the usage of unresolved static[T] parameters in proc signatures * fix tsametype and tmacrogenerics * Allow creating composite type classes with concepts and using them in type signatures * Allow integers to be used in ident concatenations * Support using imported C++ generic types in proc signatures * fixes #7230 * closes #7379 * re-enable some metatype tests
* enforce 'var T' produces a view into the first parameter; refs #7373Andreas Rumpf2018-03-241-4/+7
|