Skip to content

Conversation

reactormonk
Copy link
Contributor

No description provided.

Araq added a commit that referenced this pull request Feb 9, 2014
removed explicit return in the documentation
@Araq Araq merged commit a5d8714 into nim-lang:devel Feb 9, 2014
Araq added a commit that referenced this pull request Apr 7, 2014
removed explicit return in the documentation
Clyybber pushed a commit to Clyybber/Nim that referenced this pull request Sep 16, 2023
## Summary

Clarify the specification regarding how `when` statements within generic
object definitions work and adjust the implementation accordingly.

`when` statements inside generic object definitions are now treated as
generic. This is a breaking change, but it makes using generic
parameters in more complex expressions possible. Most notably,
`isnot` now works properly inside generic objects' `when` conditions.

## Details

* process `nkElifBranch` conditions of `nkWhenStmt` nodes within generic
  objects via `semGenericStmt` when analyzing the definition
* remove the redundant AST checks in `replaceObjBranches` and
  `replaceTypeVarsN`; the  already take place in `semRecordNode`
* use `semConstBoolExpr` instead of `semConstExpr` when evaluating
  generic `when` conditions
* `semConstBoolExpr` not returning an `nkIntLit` happens in case of
  cascading errors, so don't treat this as an internal error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants