Skip to content

Tags: yandex/implicits

Tags

1.2.0

Toggle 1.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update installation version to 1.2.0 (#55)

1.1.0

Toggle 1.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add SwiftFormat pre-commit hook (#32)

1.0.0

Toggle 1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add withScope APIs, GitHub CI, and README improvements (#1)

* Add scope checking for function calls and nested function analysis

- Add scope check for .functionCall case - closures and nested functions
  calling scope-requiring functions now properly emit "Using implicits
  without 'ImplicitScope'" error

- Implement nested function declaration traversal in RequirementsGraphBuilder:
  - Functions with scope parameter: emit "not supported" error (needs
    symbol resolution changes)
  - Functions without scope parameter: traverse body with inheritsScope=false
    and allowsStoredBagUsage=false

- Add tests for all new cases in implicit_scope_order.swift and
  stored_implicit_bag.swift

* Add withScope(nesting:) for scope inheritance and fix nested function bag validation

Runtime implementation:
- Add withScope(nesting:) function that creates nested scope inheriting from outer
- Add comprehensive documentation with inheritance example

Static analysis implementation:
- Update SemaTree.CodeBlockNode.withScope to include nested: Bool parameter
- Add getWithScopeArgs() helper to validate arguments and detect nesting
- Update RequirementsGraphBuilder to handle nested withScope with scope inheritance
- Nested scopes inherit implicits from parent, non-nested scopes are entry points

Bug fixes:
- Add diagnoseBagUsageInDisallowedContext() to properly validate bag usage
- Fix nested functions not checking allowsStoredBagUsage flag
- Fix closures propagating bag references without validation
- Update test expectations to match actual diagnostic locations (@+2 syntax)

Tests:
- Add testWithScopeNesting runtime test
- Add withScopeNestingAnother() static analysis test case
- All 20 static analysis tests passing
- All 3 WithScope runtime tests passing

* Read test resources from source tree to fix stale bundle caching

Changes to test_data files now take effect immediately without rebuild.

* Update swiftformat config and bump to Swift 6.2

- Add comprehensive swiftformat rules
- Add .swift-version file for tooling
- Apply formatting fixes

* Add withScope(with:) for implicit bag support

* Add GitHub CI and refine README

- Add GitHub Actions workflow for CI (build, test, static analysis)
- Add badges (CI, Swift version, macOS, license)
- Add installation and requirements sections
- Fix internal references in debug examples
- Add contributing section