aboutsummaryrefslogtreecommitdiff
path: root/AGENTS/SUBSYSTEMS
diff options
context:
space:
mode:
Diffstat (limited to 'AGENTS/SUBSYSTEMS')
-rw-r--r--AGENTS/SUBSYSTEMS/CLASS_LIFETIME.md7
-rw-r--r--AGENTS/SUBSYSTEMS/FUNCTIONS.md7
-rw-r--r--AGENTS/SUBSYSTEMS/STDLIB.md7
-rw-r--r--AGENTS/SUBSYSTEMS/TEMPLATES.md8
4 files changed, 18 insertions, 11 deletions
diff --git a/AGENTS/SUBSYSTEMS/CLASS_LIFETIME.md b/AGENTS/SUBSYSTEMS/CLASS_LIFETIME.md
index 19be0aa..0b12ea1 100644
--- a/AGENTS/SUBSYSTEMS/CLASS_LIFETIME.md
+++ b/AGENTS/SUBSYSTEMS/CLASS_LIFETIME.md
@@ -21,8 +21,9 @@ Part of the [subsystem notes](../SUBSYSTEMS.md). Builds on [classes](CLASSES.md)
- Assignment-only `NewExprAST` uses checked memory-library allocation (at least one byte
for method-only classes), zero initialization and construction, then rebinds
reference slots or copies into other destinations.
-- Ordinary assignment invokes an exact member OPERATOR<- when available, otherwise it
- copies.
+- Ordinary assignment prefers an exact member OPERATOR<-, then permitted BYVAL
+ conversions. Without an operator, a marked converting NEW produces a fresh value;
+ replacing a non-STRING class this way releases its previous value before transfer.
- Heap objects require explicit keyword DELETE; INHERITS/SUPER remain unsupported.
## Destruction
@@ -65,7 +66,7 @@ Part of the [subsystem notes](../SUBSYSTEMS.md). Builds on [classes](CLASSES.md)
before local handlers, while ordinary objects remain function-scoped.
- Function-result method receivers are materialized by the same path as operator
receivers.
-- Assignment first selects an exact member OPERATOR<-; without one, STRING-bearing
+- Assignment first selects a member OPERATOR<- with exact parameters preferred; without one, STRING-bearing
aggregate assignment clones string fields from lvalues or transfers them from rvalues,
releasing the target's old string fields without invoking the enclosing class
destructor; other classes are assigned bitwise.
diff --git a/AGENTS/SUBSYSTEMS/FUNCTIONS.md b/AGENTS/SUBSYSTEMS/FUNCTIONS.md
index 9555f1d..222d4da 100644
--- a/AGENTS/SUBSYSTEMS/FUNCTIONS.md
+++ b/AGENTS/SUBSYSTEMS/FUNCTIONS.md
@@ -27,7 +27,9 @@ internal __cps_main).
- `emitPrototype` records each function's pseudocode signature in a `FuncSig`
overload-set map (`FunctionGen::getOverloads`, filtered by unit visibility).
-- `resolveCall` selects exact static parameter types/ranks for OVERLOAD. When the call
+- `resolveCall` prefers exact static parameter types/ranks for OVERLOAD, then
+ marked constructor conversions for scalar BYVAL parameters. BYREF and arrays
+ remain exact; a single call never chains IMPLICIT constructors. When the call
site has an expected result type, the candidate must also return exactly that type;
a cast only prefers it. Without a context, return-only-distinct candidates use
the unique DEFAULT return, otherwise they are ambiguous. A single ordinary definition keeps implicit conversions.
@@ -57,7 +59,8 @@ internal __cps_main).
- PrototypeAST retains the operator token; FunctionGen validates operand count and
requires a record/class/enum operand.
-- Global signatures and left-class methods share exact-type selection, used by
+- Global signatures and left-class methods share exact-first selection with
+ marked BYVAL construction as fallback, used by
ValueTypeGen and ExpressionGen before builtin operations and filtered by an expected
result type where present. A strict context whose operands match but whose result does
not sets `WrongResult`. Missing candidates leave builtin rules intact; ties are
diff --git a/AGENTS/SUBSYSTEMS/STDLIB.md b/AGENTS/SUBSYSTEMS/STDLIB.md
index 07d0959..138b076 100644
--- a/AGENTS/SUBSYSTEMS/STDLIB.md
+++ b/AGENTS/SUBSYSTEMS/STDLIB.md
@@ -33,8 +33,9 @@ import rules: [CONVENTIONS/EXCEPTIONS_AND_UNITS.md](../CONVENTIONS/EXCEPTIONS_AN
- The STRING class is defined under PP_DEFINE __LIB. Its public internal void*
handle owns std::string. The _string_impl_* C ABI reports __cps_user_line and throws 0 on std::exception.
-- Functions/operators use ordinary resolution; StringValueGen bridges literals, C_STR, C
- conversions and file operands.
-- C_STRING literals have an adjacent uppercase C suffix.
+- Functions/operators use ordinary resolution and marked IMPLICIT NEW(C_STRING)
+ and NEW(CHAR). StringValueGen bridges C_STR, explicit casts, CHAR checks and files.
+- All double-quoted literals are C_STRING; the adjacent uppercase C suffix remains
+ accepted. OUTPUT and file text use the marked STRING constructor.
- STRING INPUT delegates to READ_INPUT (rest of the line, throws at end of input), OUTPUT uses C stdout buffers, and READFILE invokes
assignment from C_STRING then frees its temporary buffer.
diff --git a/AGENTS/SUBSYSTEMS/TEMPLATES.md b/AGENTS/SUBSYSTEMS/TEMPLATES.md
index b80f7ed..ffa011a 100644
--- a/AGENTS/SUBSYSTEMS/TEMPLATES.md
+++ b/AGENTS/SUBSYSTEMS/TEMPLATES.md
@@ -17,12 +17,14 @@ callable lookup.
- `CodeGen::resolveCall` retains ordinary fast paths when no templates exist. Otherwise
it computes static argument types and whole-array ranks once, selecting exact ordinary
definitions (including an expected result type when present) before non-variadic
- templates and then variadic templates. Templates still match only substituted
- parameter types; result contexts do not filter them.
+ templates and then variadic templates, then repeats these tiers with permitted
+ BYVAL conversions. Templates match substituted parameter types; result contexts
+ do not filter them.
- Explicit type arguments pre-bind positional parameters and constrain a pack prefix;
deduction from `T` or array element `T` fills remaining bindings. Composite types such
as `Box<T>` are checked after substitution but do not deduce T.
-- Every position must match exactly and every non-pack type must be bound. Candidate
+- Every non-pack type must be bound; substituted BYVAL positions may use the
+ shared conversion ranks. BYREF and arrays still match exactly. Candidate
failures stay silent; only the final no-match or ambiguity is diagnosed.
- `hasCallable` keeps CALL statement re-resolution aware of templates.