System.Runtime.CompilerServices.CallerFilePathAndLine and CallerUniqueId #4207
Unanswered
vsfeedback
asked this question in
Language Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This issue has been moved from a ticket on Developer Community.
Did anyone ever need to do any numerical computation with the CallerLineNumber? IMHO it doesn't make any sense to pass this as a number since you are only ever going to convert it to a string to write it somewhere.
I think it would make sense to either allow the CallerLineNumber attribute on a string parameter so that the conversion is only done once at compile time and/or provide a CallerFilePathAndLine attribute that'd contain both the path and the line. The exact formatting IMHO doesn't really matter, "C:\foo\bar.cs:475" is perfectly fine.
For some uses (caching) the exact value doesn't really matter as long as it's unique. Maybe a (stringified) GUID or a hash of the source file path and line or something.
Original Comments
Jane Wu [MSFT] on 3/1/2019, 01:17 AM:
Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.
Beta Was this translation helpful? Give feedback.
All reactions