Class StreamAppendsToItsSourceOrError
cat items >> items appends to
items while cat is still pulling from it - the pull never reaches the end, and at run time the
List's iterator says so. GNU cat's "input file is output file".
The same variable - by SYMBOL identity, never by name - is both a cat source and an appending target of
ONE stream statement: the >> termination, or a tee stage whose target it is (a tee appends each
element as it passes). A variable is only judged where it is written as the object's own: a local, a parameter, a
bare property, or this.property; other.items is another object's variable (same property symbol,
another object) and is never the same. A property reached two ways (this.items and bare items) is
the same symbol and IS reported.
The target's type is NOT asked: a List, a Set, a Dict, a PriorityQueue, a JSON or anything else is reported.
> is never reported - into a collection it fills a fresh one and swaps it in when the pipeline completes
(StreamStages.replacesTargetOnCompletion(int, Ek9Types, ISymbol)). An alias
(other <- items) is a different symbol and cannot be seen here - the runtime checks (a List's "changed
while it was being read", a JSON's) remain the backstop.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionStreamAppendsToItsSourceOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescription(package private) voidThe expression form (x <- cat items | tee in items | collect as ...) has no>>, but ateeat ANY stage appends to its target just the same.(package private) voidMethods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isAlreadyInError, isProcessingScopePure, isPureReassignmentDisallowed, recordATypedSymbol
-
Constructor Details
-
StreamAppendsToItsSourceOrError
StreamAppendsToItsSourceOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
-
accept
The expression form (x <- cat items | tee in items | collect as ...) has no>>, but ateeat ANY stage appends to its target just the same.
-