Skip to content

Continue parsing types: fix TypeParser.strict method limits and AvailableMethods parser bootstrap#41

Draft
Copilot wants to merge 15 commits intocopilot/experiment-image-processing-parallelizationfrom
copilot/implement-simple-low-level-class
Draft

Continue parsing types: fix TypeParser.strict method limits and AvailableMethods parser bootstrap#41
Copilot wants to merge 15 commits intocopilot/experiment-image-processing-parallelizationfrom
copilot/implement-simple-low-level-class

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

Two failing tests in the Strict.Language conversion path: LoadTypeParserFromLanguageDirectory (TypeParser.strict exceeded method/line limits) and MakeSureParsingFailedErrorMessagesAreClickable (crash in AvailableMethods when no parser is available for a GenericTypeImplementation with empty methods).

TypeParser.strict — method count and line length

  • Inlined 4 single-use helpers (IsMemberLine, GetDeclaredName, GetLeftSide, GetParameterTypeName) into their callers, reducing method count from 19 → 15 (the limit)
  • Rewrote ParseParameter from 14 lines → 6 by reusing the existing GetInitialValue helper and collapsing ternary chains to single lines

Type.cs — safe parser fallback in AvailableMethods

The from constructor auto-generation crashed with Sequence contains no elements when methods was empty, savedParser was null, and Any.Methods hadn't been populated yet (transitional state for GenericTypeImplementation):

// Before — crashes if Any.Methods is empty
: savedParser ?? GetType(Any).Methods.First().Parser, built);

// After — skips from constructor instead of crashing
var fromParser = methods.Count > 0
    ? methods[0].Parser
    : savedParser ?? GetType(Any).Methods.FirstOrDefault()?.Parser;
if (fromParser != null)
    AddFromConstructorWithMembersAsArguments(fromParser, built);

The from constructor will be added correctly once ReimplementMethods runs after InvalidateAllAvailableMethodsCaches.

Known remaining gaps

  • LoadTypeParserFromLanguageDirectory inline tests still reference TypeParser("Language") but the type is registered as LanguageTypeParser — needs a two-line rename in TypeParser.strict
  • MakeSureParsingFailedErrorMessagesAreClickable still fails with ">" not found for Strict/Number during constraint parsing for Name.strictNumber.AvailableMethods is returning an incomplete set; root cause not yet resolved

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI and others added 7 commits March 21, 2026 04:03
…n blockers

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/b5bc9b30-bdfc-42d3-a6e9-67f65187dcd8
…Operator as .strict files

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/a2f2fc79-71ad-43be-9692-7e95c81c6a44
…on progress

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/1ad2b37c-a30b-41e2-8b2f-160ba789d04c
… method bodies

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/47167b73-ed23-46f0-aa07-fa3d4026898e
… NamedType.strict and add tests

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/46353089-c65f-4c8a-abb9-2adaeb0823da
…rect underlying characters correctly, which works now. some code changes are a bit verbose, but at least everything works atm
BenjaminNitschke and others added 3 commits March 22, 2026 01:41
…od, Type, TypeLines and TypeParser .. not fully working yet ..
…f instead of StartsWith

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/6541c6fd-b610-4c97-9f97-c11c1c833c4e
Copilot AI changed the title Implementing simplest low level class in Strict Forbid dot-notation operator calls; add CountMembers/MemberLines to TypeLines.strict Mar 22, 2026
Copilot AI requested a review from BenjaminNitschke March 22, 2026 00:45
…, update TypeLines.strict

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/2ef5a58c-f079-42ca-8f6e-5aaae6a83b57
Copilot AI changed the title Forbid dot-notation operator calls; add CountMembers/MemberLines to TypeLines.strict Fix nested for-loop variable shadowing; add StartsWith to TestPackage and TypeLines.strict Mar 22, 2026
…lableMethods

Co-authored-by: BenjaminNitschke <1650127+BenjaminNitschke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strict-lang/Strict/sessions/f0f086fe-dda8-4831-9356-8bc856a2160a
Copilot AI changed the title Fix nested for-loop variable shadowing; add StartsWith to TestPackage and TypeLines.strict Fix StartsWith/LastIndexOf in for-loops, TypeParser.strict line limits, and AvailableMethods parser bootstrap Mar 22, 2026
Copilot AI changed the title Fix StartsWith/LastIndexOf in for-loops, TypeParser.strict line limits, and AvailableMethods parser bootstrap Continue parsing types: fix TypeParser.strict method limits and AvailableMethods parser bootstrap Mar 22, 2026
…sical, a 1:1 conversion just doesn't make sense, many concepts will be simpler in strict and this is also not a great way to start, plus there are very strange language usage bugs (calling .from directly) that make no sense
…oncepts and not even worth refactoring, we need a simpler start
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.

2 participants