-
Notifications
You must be signed in to change notification settings - Fork 199
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
RazorProjectService cleanup #10989
Merged
davidwengier
merged 5 commits into
dotnet:main
from
davidwengier:CleanUpRazorProjectService
Oct 9, 2024
Merged
RazorProjectService cleanup #10989
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f1937db
Move unused methods to test accessor
davidwengier 5ead4f8
Use interface method instead of test accessor
davidwengier 15dd1df
Remove tests that validate impossible user scenarios
davidwengier a42e09c
Rename tests
davidwengier 365b5cc
Fix up the final AddProject tests
davidwengier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short answer: it makes the compiler happy
Long answer: The test accessor is a struct, and a lambda in a struct can't access a member of the struct. Or at least that's what I took the error to mean when the compiler complained at me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah interesting, so this is causing it to box? Will have to look more, but at first glance it was weird. Newfangled C#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would have to box the instance, and I guess they want that to be explicit and not hidden. I don't begin to understand this low level stuff :)
The error was CS1673 IIRC and you wanted to look up more about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a problem because you're capturing a primary constructor parameter that is ultimately backed by a field on the struct. So, you're really capturing an instance field which means that the lambda must capture
this
, which requires boxing the struct. Otherwise, the closure would contain a copy of the struct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the two errors @davidwengier likely ran into:
https://sharplab.io/#v2:EYLgtghglgdgNAExAagD4AEBMBGAsAKHQAYACdbAOgBlYBHAbgIPQGYSAnAUwgQHsYANgE8SAZwAu7AK4BjcSQDK2ABTlSogJQkA3gRL6ybYL14CSAYX7joMUauxEA2gF0SEduwhCtu/Af9kAOxuHl4UAOoAFpxcygAeJAC8AHwkCYmJYhoUAIIwQsoajH4GAL4E5fjMbFw8/MJikrLyCpj26j56BgAO7FAAbhDinBzcfIIiaiQA+qJJYsX+XfqsJMamFlY2dmouIZ7eOssB6MHuBxHRsemp6Zmz2XkFRceVpUA=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, this definitely makes sense. In a PR it looks weird but wholistically in the language is 👍