-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Bug 217740: don't crash when emitting or loading a DateTimeConstant(-1) attribute #11536
Merged
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0e97699
Bug 217740: Repro and test harness for C#
jcouv 255d39d
Testing and fixing loading scenario in C# and VB
jcouv 8cfaf34
Verifying VB case using attribute on field
jcouv 1b0abed
Adding more tests
jcouv a2072f0
Adding VB tests
jcouv 9523309
Adding tests
jcouv 7744381
More tests on fields with double-attributes
jcouv aab3bb8
New test constraint
jcouv 5654f9d
Fixing VB side to new test constraints
jcouv d722b1c
Fixing C# side to new test constraints
jcouv e7f5645
Fixing remaining tests
jcouv 784703f
Adding comments
jcouv 9da1381
Fixing VB field scenario too
jcouv 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
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.
I think we need to have a test that tries to consume this method without providing the argument
Is behavior for these scenarios consistent with native compiler?
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.
Should test the same when default value is explicitly set through the special syntax on the parameter.
Should test similar scenarios for VB too.
In reply to: 64497023 [](ancestors = 64497023)
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.
What we need to watch out for in cases when values are also provided through special syntax is that we wouldn't try to emit two or more DateTimeConstantValue attributes.
In reply to: 64497476 [](ancestors = 64497476,64497023)
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.
I already manually verified the behavior when referencing metadata. The behavior is consistent, an error is reported (C# used to report
error CS1501: No overload for method 'Method' takes 0 arguments
and VB used to reporterror BC30455: Argument not specified for parameter 'p' of 'Public Function Method(p As Date = #12:00:00 AM#) As Date'
).I cannot do compilation reference with native compiler.
I added a test for both scenarios (C# and VB).
I'll add test for "double attribute" concern.
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.
The "double attribute" scenario works fine in C# (only one is emitted), but VB emits two. I'll stop by.
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 looks like C# never synthesizes the attribute.
In reply to: 64610028 [](ancestors = 64610028)