-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Avoid auto conversion of char[] to string in vb #79248
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
Conversation
|
@RikkiGibson ptal. |
|
|
||
| Friend Function Intern(s As Char(), start As Integer, length As Integer) As String | ||
| Return _stringTable.Add(s, start, length) | ||
| Return _stringTable.Add(s.AsSpan(start, length)) |
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.
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 will take #79245 for now to address the concern. Let's work out a solution for the broader set of lexer/TextWindow changes which doesn't require VB to use spans.
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 really understanding the problem here with this. In what way are ref-structs not supported here? VB seems find creating the span and passing it along.
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 can still have the overloads that take the char[]+start+length. but i don't see how that is substantively better.
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.
In what way are ref-structs not supported here?
VB doesn't support consumption of ref structs. It is supposed to block any attempt to do this, and for many scenarios it does. However, several "holes" remain, that is not intentional though, and it doesn't make ref structs supported in VB.
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.
Good to know.
RikkiGibson
left a comment
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.
AlekseyTs
left a comment
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.
It looks like this change takes dependency on VB compiler bug that allows ref structs to be used in some scenarios. I am not comfortable doing this. An alternative approach would be to add special helpers to the shared layer (written in C#) for use from VB, the helpers can use ref structs in their implementation, but should neither take, nor return ref structs.
|
sure. i've added back in the helpers to allow vb to call this. |
|
Closing in favor of #79250 |
No description provided.