AnAspect.OneOf is currently in early experimental stage (v0.1.0-alpha). This means:
GitHub: https://github.com/Pouria7/AnAspect.OneOf
- NOT recommended for production use
- Breaking changes will occur between versions
- APIs may change significantly
- Bugs and edge cases are expected
-
Feature Incomplete
- Only
OneOf<T1, T2>supported (no higher arities) - Some methods not optimized (TryGet)
- Limited transformation scope (locals only, not fields/parameters)
- Only
-
Testing Limited
- Basic functionality tested
- Edge cases may not be covered
- Performance characteristics may vary across scenarios
-
Debugging Experience
- Debugger shows
objectinstead ofOneOf<T1, T2>after weaving - Stack traces may be confusing
- IL inspection required to verify transformations
- Debugger shows
-
IL Weaving Risks
- IL manipulation is inherently fragile
- Can break with C# compiler changes
- May interact poorly with other IL weavers
- Native AOT compatibility unknown
✅ Good for:
- Experimentation and learning
- Proof-of-concept projects
- Performance research
- Contributing to development
❌ Not ready for:
- Production applications
- Mission-critical systems
- Shipped libraries
- Long-term maintenance
-
Functional
- Only 2-type OneOf supported
- TryGet methods not weaved
- No custom serialization
- No analyzer support
-
Technical
- Debugger experience suboptimal
- No official support
- Documentation incomplete
- Breaking changes expected
-
Ecosystem
- Not compatible with all other Fody weavers
- May conflict with reflection-heavy libraries
- Serialization requires custom handling
We aim to reach these milestones before production-ready:
- v0.2.0-alpha: Add
OneOf<T1, T2, T3, T4>support - v0.3.0-alpha: Implement TryGet weaving
- v0.4.0-beta: Field/parameter/return type retargeting
- v0.5.0-beta: Comprehensive test coverage
- v0.6.0-rc: Roslyn analyzers
- v1.0.0: First stable release (API stable, production-ready)
If you encounter issues:
- Check if it's a known limitation (see above)
- Verify Fody ran (check for "ProcessedByFody" attribute)
- Inspect IL using ILSpy/dotPeek
- Open GitHub issue with minimal repro
Contributions welcome! See CONTRIBUTING.md for guidelines.
If you need production-ready discriminated unions, consider:
- OneOf - Mature, stable
- LanguageExt - Functional programming library
- Plain inheritance/interfaces - Traditional OOP approach
By using this library, you acknowledge that it is experimental and accept the risks outlined above.
Last updated: 2024-XX-XX | Version: 0.1.0-alpha