Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve custom operators #2125

Merged
merged 5 commits into from
Jul 8, 2021
Merged

Preserve custom operators #2125

merged 5 commits into from
Jul 8, 2021

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jun 30, 2021

This will keep custom operators on marked types whenever System.Linq.Expressions
is used, and the operator input types are marked.

The behavior is enabled by default, and can be disabled by passing
--disable-operator-discovery.

Addresses #1821

This will keep custom operators on marked types whenever System.Linq.Expressions
is used, and the operator input types are marked.

The behavior is enabled by default, and can be disabled by passing
--disable-operator-discovery.

Addresses dotnet#1821
- Avoid processing pending operators Dictionary if Linq.Expressions is unused
- Allocate this possibly-unused Dictionary lazily
- Use readonly field for always-used HashSet
- Rename markOperators -> seenLinqExpressions
- Clean up ProcessCustomOperators call to make intent more clear
- Add comments
- Check MetadataType.Int32 instead of searching BCL for Int32
@sbomer sbomer marked this pull request as ready for review July 2, 2021 19:48
- seenLinqExpressions -> _seenLinqExpressions
- use List for pending operators instead of HashSet
@sbomer sbomer merged commit 6b0da00 into dotnet:main Jul 8, 2021
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* Preserve custom operators

This will keep custom operators on marked types whenever System.Linq.Expressions
is used, and the operator input types are marked.

The behavior is enabled by default, and can be disabled by passing
--disable-operator-discovery.

Addresses dotnet/linker#1821

* Fix behavior for operators on nullable types

* Cleanup and PR feedback

- Avoid processing pending operators Dictionary if Linq.Expressions is unused
- Allocate this possibly-unused Dictionary lazily
- Use readonly field for always-used HashSet
- Rename markOperators -> seenLinqExpressions
- Clean up ProcessCustomOperators call to make intent more clear
- Add comments
- Check MetadataType.Int32 instead of searching BCL for Int32

* Remove unnecessary parens

* PR feedback

- seenLinqExpressions -> _seenLinqExpressions
- use List for pending operators instead of HashSet

Commit migrated from dotnet/linker@6b0da00
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.

None yet

3 participants