-
Notifications
You must be signed in to change notification settings - Fork 220
Source location #357
Source location #357
Conversation
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'm not sure how attached we are to these operators - they are scarcely used in our code.
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.
Also confirmed with Todd that these operators aren't used in tooling.
11821a4
to
c3fb74e
Compare
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.
Will fix.
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.
was this fixed?
|
⌚ |
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 scenarios will continue to use this constructor? for example, could it be internal
and used only in tests?
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.
We use this one all over the place - I'm being pretty lazy in this PR and specifically using the other ctor when creating inherited Chunks in Mvc. The existing code continues to use this ctor.
⌚ |
* Using SourceLocation.FilePath when printing line pragmas, if available.
c3fb74e
to
7a3e122
Compare
Updated |
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 doesn't the comparer handle
null
? - adding the wrong value to the hash. either return
Add(hashCode)
or do whatAdd(object)
does:
Add(hashCode);
return this;
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.
also, if the comparer can't handle null
suggest making a similar change to Add(object)
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.
Unfortunately the comparer performs a null check so this ends up throwing. I'll fix the hash code
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.
including the file in a relative location seems a bit nonsensical. one possibility would be for -
to return a SourceLocation
with FilePath==null
(maintaining current comparison of input FilePath
values) and +
to throw
if both SourceLocations
have FilePath!=null
, then return a new SourceLocation
with the non-null
FilePath
(if any).
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'm neutral about this - subtraction isn't used anywhere in the codebase. Additions are used where the right operand is a relative location and it's used in calculating the offset from document start. So it sort of makes sense to preserve the document location in that case.
⌚ |
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.
nit: no 's' in WriteLineNumberDirective_
⌚ |
Should investigate travis failures. It's pasing fine on dev branch. |
Updated |
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.
can't use [NotNull]
here. breaks other constructor.
⌚ mainly for |
Updated. |
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.
add , and neither is null
|
Ties into aspnet/Mvc#2321