You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codegen: a nested type constructed by its bare name inside the enclosing type (N()) is emitted as a member invocation — CS1955 behind SPY0908 #2397
Contract: a nested type's name read bare inside its enclosing type's body denotes the TYPE in every position. A call N() constructs it (new N()), exactly as C.N() does from outside.
class C:
class N:
tag: int = 3
def m(self) -> int:
return N().tag
def main():
print(C().m())
run @ 9aae969 (and @ 35783f9): SPY0908 CS1955 "Non-invocable member 'C.N' cannot be used like a method". The call is emitted as an invocation of the member N, not as new N(). Expected: 3.
SPY0401 (not a constant; the refusal is correct there)
same
The cells agree across every position, so the defect is on the callee-kind axis (a nested type as a bare callee from the enclosing body), not P21h's read-position axis. Related but different: #1894 (bare nested-type reference in a GENERIC host drops the type arguments, CS0305).
Batching 2026-10-29 @ 04f9138 — charter .claude/plans/remediation-round-2026-09-20-batching.md §3.33, P16 — type-denoting reference totality (row 33; full (c); placed by class under R-JW, no ruling of its own).
Contract (P16's): every spelling of a type reference reaches the same verdict in every position — the callee-kind axis gains nested type, bare, from the enclosing body beside #1894's generic-host cells (one carrier). Measured at batching (built sharpyc, the 04f9138 tree, lock-free): bare N().tag in the enclosing method → SPY0908 CS1955 (this issue's cell); the controls C.N().tag and n: C.N = C.N() print 3 3 — the Python-habit spelling runs (Python's class scope is invisible in methods, so Python code writes C.N()); the failing spelling is C#'s habit, which is why the cell waits for P16's carrier rather than a chore. The cells agree across read positions, so the axis is callee kind, not P21h's read position (the issue's own axis change). Lane ice · reach program. This issue is the tracker for the callee cell; #1894 keeps the generic-host cells.
Cells from P77a's name-resolution harness. 27 allowlist rows now cite this issue: a bare nested type read inside its enclosing type, SPY0908 CS1061 / CS0149 / CS0266 at member, method, comprehension and lambda positions (read/NestedType/*). They carried the harness's default route before; the verify round routed them here by contract. Whether this issue's fix drains every one is unproven until it lands, and a row that moves is red.
A sibling the harness does not generate, re-run @ 5f8a4c4e2:
Drain set @ fd925ddca (measured): 27 rows cite this issue: CS0149 / CS0266 / CS1061 for a nested type. They cited #2423 only through a default arm in the harness's route, which is gone.
Drain set after P77b (name-resolution differential, branch remote/p77b-implement-plan @ 0c0bdcf)
53 rows of src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt cite this issue (27 at the plan base 2279c0d), all read/NestedType/... Ice. When the cure lands, every one of these rows must drain: a stale row fails the sweep.
Where the 26 new rows come from:
22 from a4dcf02, which restored READ's pruned outers;
4 from 8886c04 (axis 10, DeclaringRelation), where H5 routed the sibling-relation CS1955 cells here.
Another 154 read/NestedType/... Ice rows (CS1955) still cite #2423. Whether they belong here is raised on #2423.
To list them: grep -n '# #2397' src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt
A contradiction with the name-resolution harness, for an owner's letter at the next /batch-issues. Found by P77b's /verify-implementation refuter @ 8c0602b, by reading.
This issue's Contract says N() inside the enclosing type constructs the nested type and prints 3. The harness's axis 10 (sibling nested type, Bare) is MustRefuse rule N1-methods, because a class-body name is not bare inside a nested body and python raises NameError(I). One program, two verdicts. 140 of this issue's 207 allowlist rows are tagged must-refuse (N2 51, N1-type-error 49, N1-methods 34, SPY0401 6), so curing it as the Contract says moves those rows to a loud red instead of draining them. Sample cells: read/NestedType/DataclassFieldInitializer/Earlier/Bare/outer=ModuleEnum, read/NestedType/InitBody/Later/Bare/outer=None.
(a) The Contract narrows to a nested type's own enclosing scope where N1 allows it, and the harness verdict stands.
(b) Axis 10 changes to MustRun, an N1-methods exception for a nested type's bare name: a designed deviation from python's NameError.
Recommendation: (a). N1 is the design of record, and (b) adds a deviation with no owner ruling behind it. The door is one-way for (b): a run verdict is hard to withdraw once programs depend on it.
The ledger of cites that move rather than drain is on #2433.
Owner ruling, 2026-11-07: (a) the Contract narrows, and the harness's verdict stands. For the next /batch-issues to letter. Measured with sharpyc run (no compiler source differs from 8c0602b through f02932c) against python3 -I.
The Contract now reads: a nested type's bare name in a position where N1 allows a class-body name (the class body itself) denotes the type, and a call constructs it. In a method, nested function, lambda or comprehension element, a bare value read of it is refused unless an outer binding of the name exists, in which case it reads that binding. The spelling there is C.N().
shape
Sharpy today
python
under the ruling
method body, return N().tag
SPY0908 CS1955
NameError
refused, a diagnostic and not an ICE
class body, b: int = N().tag
SPY0908 CS1955
3
runs, 3
sibling nested type, I().v from J's method
SPY0908 CS1955
NameError
refused
method body, C.N().tag
3
3
unchanged
method body with a module class N, N().tag
9
9
unchanged
So both the must-refuse rows and the other 67 of this issue's 207 allowlist rows need the cure: this is still an ICE to fix in every position, in two directions.
Three further cells from the same check, not yet ruled:
shape
Sharpy
python
class
module class N and nested N, method body isinstance(o, N) with o = C.N()
True
False
silent wrong: the bare name reaches the nested type where python reads the module's
nested N only, same isinstance
True
NameError
a value position that N1 refuses runs
method body, self.N().tag
SPY0203 "Type 'C' has no member 'N'"
3
false refusal, and python's own NameError suggests that spelling
Type positions are not value reads and are left as they are: n: N = C.N() and def m(self) -> N: both print 3, as python does.
Drain set @ 87ac3853e (P77b, PR #2453 merged into dev): 207 allowlist row(s) cite this issue.
Measured from src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt @ 87ac3853e (origin/dev; the name-resolution differential harness, pool 8889, allowlist 2595 rows, 19 cited issues). Each row is a generated cell that pins its verdict class: the fix for this issue turns the cell green, the ratchet then reports the row STALE, and the row is deleted with the fix. This comment supersedes the P77a drain-set comment of 2026-11-05 on this issue (where one exists) and any drain-set comment from the reverted first P77b attempt; the counts here are the merged ones. Family is the first segment of the cell id; the lane is the row's own.
Batching 2026-11-08 @ 10e1c1b — charter docs/process/rounds/remediation-round-2026-09-20-batching.md §3.33, P16 — type-denoting reference totality (order 33). Two letters:
R-MG (owner, 2026-11-07, lettered at this call): (a) the Contract narrows, and the harness's verdict stands. A nested type's bare name denotes the type where N1 allows a class-body name (the class body: b: int = N().tag runs, 3); in a method, nested function, lambda or comprehension element a bare value read is refused unless an outer binding exists, in which case it reads that binding; the spelling there is C.N(). Both the must-refuse rows and the class-body rows of the 207 need the cure — still an ICE in every position, in two directions. Rejected: (b) the harness yields to the issue's original contract (bare N() constructs everywhere).
R-LQ (owner, 2026-11-08): (a) self.N() is ADMITTED, lowered type-qualified as C.N() — one rule for class attributes read through self, the rule P30 (#2147) already gives const/static members; python prints 3 and its own NameError steers users to this spelling; today SPY0203. One-way for programs that then compile. Rejected: (b) keep the refusal with a C.N() steer.
The two isinstance cells of your 11-07 comment follow R-MG with no ruling of their own: a bare N in a method body is a value read, so with a module N it reads the module's (python False) and with none it is refused (python NameError). Type positions stay as they are.
Cell from P78's planning (plan-777361, PR #2767), 2026-11-20 — 32 name-resolution allowlist rows that are R-LQ's currently cite #2423.
In src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt @ e24aaf9, 32 rows citing #2423 are rule N7, family read/NestedType/…, spellings SelfDot / alias: self.N() or A.N() on a nested type. Every one is tagged must-run, python runs it, and Sharpy refuses with SPY0203 (+ SPY0453). Counted by joining the allowlist with the sweep's cell dump from a run at that sha (299/0/0 on the name-resolution filter).
Example (read/NestedType/AccessorGetBody/Earlier/SelfDot/outer=None):
R-LQ (charter §4) admits self.N() on a nested type, lowered C.N(), and gave it to P16 under this issue. P78 is Semantic-only and does not implement it, so P78's stage 0 re-cites these 32 rows from #2423 to #2397; they drain with P16, not with #2423's close.
Activity
antonsynd commentedon Oct 30, 2026
Batching 2026-10-29 @ 04f9138 — charter
.claude/plans/remediation-round-2026-09-20-batching.md§3.33, P16 — type-denoting reference totality (row 33; full (c); placed by class under R-JW, no ruling of its own).Contract (P16's): every spelling of a type reference reaches the same verdict in every position — the callee-kind axis gains
nested type, bare, from the enclosing bodybeside #1894's generic-host cells (one carrier). Measured at batching (builtsharpyc, the 04f9138 tree, lock-free): bareN().tagin the enclosing method → SPY0908 CS1955 (this issue's cell); the controlsC.N().tagandn: C.N = C.N()print3 3— the Python-habit spelling runs (Python's class scope is invisible in methods, so Python code writesC.N()); the failing spelling is C#'s habit, which is why the cell waits for P16's carrier rather than a chore. The cells agree across read positions, so the axis is callee kind, not P21h's read position (the issue's own axis change). Lane ice · reach program. This issue is the tracker for the callee cell; #1894 keeps the generic-host cells.antonsynd commentedon Nov 5, 2026
Cells from P77a's name-resolution harness. 27 allowlist rows now cite this issue: a bare nested type read inside its enclosing type, SPY0908 CS1061 / CS0149 / CS0266 at member, method, comprehension and lambda positions (
read/NestedType/*). They carried the harness's default route before; the verify round routed them here by contract. Whether this issue's fix drains every one is unproven until it lands, and a row that moves is red.A sibling the harness does not generate, re-run @
5f8a4c4e2:~is a newline.5f8a4c4e2nest_sibling_earlier_nonePrograms
nest_sibling_earlier_noneantonsynd commentedon Nov 5, 2026
Drain set @
fd925ddca(measured): 27 rows cite this issue: CS0149 / CS0266 / CS1061 for a nested type. They cited #2423 only through a default arm in the harness's route, which is gone.Rows
These shas are on local
dev, not pushed yet.test(p77a): verify round: the harness reads what it claimed to read (#…
ci(p77a): the name-resolution sweep fails without python; contract ro…
test(p77b): restore READ's pruned outers and builtins under a ReadOut…
test(p77b): axis 10 - the sibling nested type (plan D2 axis 10)
antonsynd commentedon Nov 6, 2026
Drain set after P77b (name-resolution differential, branch
remote/p77b-implement-plan@ 0c0bdcf)53 rows of
src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txtcite this issue (27 at the plan base 2279c0d), allread/NestedType/...Ice. When the cure lands, every one of these rows must drain: a stale row fails the sweep.Where the 26 new rows come from:
DeclaringRelation), where H5 routed the sibling-relation CS1955 cells here.Another 154
read/NestedType/...Ice rows (CS1955) still cite #2423. Whether they belong here is raised on #2423.To list them:
grep -n '# #2397' src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txtGenerated by Claude Code
antonsynd commentedon Nov 7, 2026
A contradiction with the name-resolution harness, for an owner's letter at the next
/batch-issues. Found by P77b's/verify-implementationrefuter @ 8c0602b, by reading.This issue's Contract says
N()inside the enclosing type constructs the nested type and prints3. The harness's axis 10 (sibling nested type, Bare) isMustRefuseruleN1-methods, because a class-body name is not bare inside a nested body and python raisesNameError(I). One program, two verdicts. 140 of this issue's 207 allowlist rows are tagged must-refuse (N2 51, N1-type-error 49, N1-methods 34, SPY0401 6), so curing it as the Contract says moves those rows to a loud red instead of draining them. Sample cells:read/NestedType/DataclassFieldInitializer/Earlier/Bare/outer=ModuleEnum,read/NestedType/InitBody/Later/Bare/outer=None.MustRun, an N1-methods exception for a nested type's bare name: a designed deviation from python'sNameError.The ledger of cites that move rather than drain is on #2433.
test(p77b): restore READ's outers and the builtins under ReadOuter (D…
test(p77b): R-KX and R-LI, a read above a same-scope declaration is m…
test(p77b): R-KY, a store over a def or type name is must-refuse N6-t…
test(p77b): R-KZ, a match or as capture reused after its arm is must-…
test(p77b): R-LA, a construct target reusing a builtin's name is must…
test(p77b): R-LH, a bare store over a method's name is must-refuse SP…
test(p77b): R-LF's seeds and the global-creates-binding door; two unr…
test(p77b): a sibling nested type, the declaring relation's fifth val…
antonsynd commentedon Nov 7, 2026
Owner ruling, 2026-11-07: (a) the Contract narrows, and the harness's verdict stands. For the next
/batch-issuesto letter. Measured withsharpyc run(no compiler source differs from 8c0602b through f02932c) againstpython3 -I.The Contract now reads: a nested type's bare name in a position where N1 allows a class-body name (the class body itself) denotes the type, and a call constructs it. In a method, nested function, lambda or comprehension element, a bare value read of it is refused unless an outer binding of the name exists, in which case it reads that binding. The spelling there is
C.N().return N().tagNameErrorb: int = N().tagI().vfromJ's methodNameErrorC.N().tagN,N().tagSo both the must-refuse rows and the other 67 of this issue's 207 allowlist rows need the cure: this is still an ICE to fix in every position, in two directions.
Three further cells from the same check, not yet ruled:
Nand nestedN, method bodyisinstance(o, N)witho = C.N()TrueFalseNonly, sameisinstanceTrueNameErrorself.N().tagNameErrorsuggests that spellingType positions are not value reads and are left as they are:
n: N = C.N()anddef m(self) -> N:both print 3, as python does.antonsynd commentedon Nov 7, 2026
Drain set @
87ac3853e(P77b, PR #2453 merged intodev): 207 allowlist row(s) cite this issue.Measured from
src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt@87ac3853e(origin/dev; the name-resolution differential harness, pool 8889, allowlist 2595 rows, 19 cited issues). Each row is a generated cell that pins its verdict class: the fix for this issue turns the cell green, the ratchet then reports the row STALE, and the row is deleted with the fix. This comment supersedes the P77a drain-set comment of 2026-11-05 on this issue (where one exists) and any drain-set comment from the reverted first P77b attempt; the counts here are the merged ones. Family is the first segment of the cell id; the lane is the row's own.All 207 row(s)
Generated by Claude Code
antonsynd commentedon Nov 8, 2026
Batching 2026-11-08 @ 10e1c1b — charter
docs/process/rounds/remediation-round-2026-09-20-batching.md§3.33, P16 — type-denoting reference totality (order 33). Two letters:R-MG (owner, 2026-11-07, lettered at this call): (a) the Contract narrows, and the harness's verdict stands. A nested type's bare name denotes the type where N1 allows a class-body name (the class body:
b: int = N().tagruns, 3); in a method, nested function, lambda or comprehension element a bare value read is refused unless an outer binding exists, in which case it reads that binding; the spelling there isC.N(). Both the must-refuse rows and the class-body rows of the 207 need the cure — still an ICE in every position, in two directions. Rejected: (b) the harness yields to the issue's original contract (bareN()constructs everywhere).R-LQ (owner, 2026-11-08): (a)
self.N()is ADMITTED, lowered type-qualified asC.N()— one rule for class attributes read throughself, the rule P30 (#2147) already gives const/static members; python prints 3 and its ownNameErrorsteers users to this spelling; today SPY0203. One-way for programs that then compile. Rejected: (b) keep the refusal with aC.N()steer.The two
isinstancecells of your 11-07 comment follow R-MG with no ruling of their own: a bareNin a method body is a value read, so with a moduleNit reads the module's (pythonFalse) and with none it is refused (pythonNameError). Type positions stay as they are.Generated by Claude Code
antonsynd commentedon Nov 20, 2026
Cell from P78's planning (plan-777361, PR #2767), 2026-11-20 — 32 name-resolution allowlist rows that are R-LQ's currently cite #2423.
In
src/Sharpy.Compiler.Tests/Conformance/name-resolution-differential-allowlist.txt@ e24aaf9, 32 rows citing #2423 are ruleN7, familyread/NestedType/…, spellingsSelfDot/ alias:self.N()orA.N()on a nested type. Every one is tagged must-run, python runs it, and Sharpy refuses with SPY0203 (+ SPY0453). Counted by joining the allowlist with the sweep's cell dump from a run at that sha (299/0/0 on the name-resolution filter).Example (
read/NestedType/AccessorGetBody/Earlier/SelfDot/outer=None):python3 (3.15.2):
20. Sharpy: SPY0203.R-LQ (charter §4) admits
self.N()on a nested type, loweredC.N(), and gave it to P16 under this issue. P78 is Semantic-only and does not implement it, so P78's stage 0 re-cites these 32 rows from #2423 to #2397; they drain with P16, not with #2423's close.Generated by Claude Code
test(conformance): P78 stage 0: re-cite 32 nested-type rows to #2397
process(plan): plan-777361 (P78) revised before pass 1