Skip to content

Fix spaces around module selectors in generics - #2660

Merged
calda merged 2 commits into
developfrom
copilot/fix-spaces-around-module-selectors
Aug 20, 2026
Merged

Fix spaces around module selectors in generics#2660
calda merged 2 commits into
developfrom
copilot/fix-spaces-around-module-selectors

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

When a module selector (::) appears inside generic angle brackets, the tokenizer didn't recognize :: as a valid operator within a generic scope. This caused < to be reclassified from startOfScope to operator, and spaceAroundOperators then inserted spaces around it:

// Before (incorrect)
let x: AnyPublisher <ModuleName::EntityName, Never>

// After (correct)
let x: AnyPublisher<ModuleName::EntityName, Never>
  • Added "::" to the whitelist of operators allowed inside <...> generic scopes in Tokenizer.swift

Add `::` to the list of operators allowed inside generic angle brackets
in the tokenizer, preventing `<` from being misidentified as an
operator when a module selector appears in generic type parameters.

Co-authored-by: calda <1811727+calda@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unexpected spaces around module selectors Fix spaces around module selectors in generics Aug 20, 2026
Copilot AI requested a review from calda August 20, 2026 14:39
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (df2c5bd) to head (600204b).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2660   +/-   ##
========================================
  Coverage    95.45%   95.46%           
========================================
  Files          178      178           
  Lines        27137    27137           
========================================
+ Hits         25904    25905    +1     
+ Misses        1233     1232    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@calda
calda marked this pull request as ready for review August 20, 2026 14:46
@calda
calda merged commit 93a58f9 into develop Aug 20, 2026
22 checks passed
@calda
calda deleted the copilot/fix-spaces-around-module-selectors branch August 20, 2026 14:46
Copilot AI linked an issue Aug 20, 2026 that may be closed by this pull request
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.

Spaces around module selectors

2 participants