Skip to content

cleanup pragma for null constraint#790

Merged
bitfaster merged 1 commit into
mainfrom
users/alexpeck/prama
Apr 28, 2026
Merged

cleanup pragma for null constraint#790
bitfaster merged 1 commit into
mainfrom
users/alexpeck/prama

Conversation

@bitfaster
Copy link
Copy Markdown
Owner

@bitfaster bitfaster commented Apr 28, 2026

The type TKey for ICache etc. does not have a notnull constraint. Therefore if the alt lookups constrain the key to notnull, it generates build warnings.

This change makes the generic constraints for TKey match across interfaces. This can be added back cleanly in v3.0.

It is a breaking change to add the notnull constraint to ICache:
error CP0021: Cannot add constraint 'notnull' on type parameter 'K' of 'BitFaster.Caching.ICache<K, V>'.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.18% (+0.06%) from 99.123% — users/alexpeck/prama into main

@bitfaster bitfaster merged commit b1506c3 into main Apr 28, 2026
16 checks passed
@bitfaster bitfaster deleted the users/alexpeck/prama branch April 28, 2026 23:14
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