spec for view types (#15424)
* spec for view types * spec additions * refactoring; there are two different kinds of views * refactorings and spec additions * enforce that view types are initialized * enforce borrowing from the first formal parameter * enforce lifetimes for borrowing of locals * typo in the manual * clarify in the implementation what a borrow operation really is
This commit is contained in:
parent
f8866598e7
commit
4058801607
11 changed files with 446 additions and 66 deletions
|
|
@ -10,7 +10,7 @@
|
|||
import
|
||||
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents, trees,
|
||||
wordrecg, strutils, options, guards, lineinfos, semfold, semdata,
|
||||
modulegraphs, varpartitions
|
||||
modulegraphs, varpartitions, typeallowed
|
||||
|
||||
when defined(useDfa):
|
||||
import dfa
|
||||
|
|
@ -1244,7 +1244,7 @@ proc trackProc*(c: PContext; s: PSym, body: PNode) =
|
|||
|
||||
var mutationInfo = MutationInfo()
|
||||
if {strictFuncs, views} * c.features != {}:
|
||||
var partitions = computeGraphPartitions(s, body)
|
||||
var partitions = computeGraphPartitions(s, body, g.config)
|
||||
if not t.hasSideEffect and t.hasDangerousAssign:
|
||||
t.hasSideEffect = varpartitions.hasSideEffect(partitions, mutationInfo)
|
||||
if views in c.features:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue