[wasm][debugger] Support indexing by value type schema#92334
[wasm][debugger] Support indexing by value type schema#92334ilonatommy wants to merge 15 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @thaystg Issue Details
while in other scenarios, the nesting in enums do not occur and values look e.g. like this: Because we want In
|
What are the cases when these two separate forms are emitted? Why not just one? |
|
Failures after merge with main: Reason: all types: class Indexer, enum EnumIndexer and struct StructIndexer are decoded as "object", even though ElementType defines ValueType and we would expect the two latter to return ValueType:. As a consequence, when we evaluate indexing by struct: f[StructIndexer] and use CheckParametersCompatibilityto check compatibility of method get_Items(Indexer), where indexObject is:
we are not able to detect type incompatibility (struct cannot be passed to instead of: |
Nested result:
Non-nested:
When we fix the passed argument, we can revert try-catch (and we stay with nested version everywhere). |
Update to this question after reverting the try-catch. Test that fails: Reason: We could change the static members resolution behavior to be nested but it seems wrong and artificial. I think it will be better to go back to 2-version handling instead, @radical. |
|
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Fixes partially #77536.
SyntaxNodereturnsIdentifierNameSyntaxvalue that is nested like this:while in other scenarios, the nesting in enums do not occur and values look e.g. like this:
Because we want
ConvertJSToCSharpLocalVariableAssignmentto handle both cases, try-catch expression was added (checking type with "is" keyword does not work here as we are casting and exception happens in the cast).In
GetVariableDefinitionswe handle enum case separately as a workaround to the following:In the original version of code, we would produce variable definition that looks like this:
DebuggerTests.castToEnumTypeThatIsDefinedInExternalAssembly enumIdx = (DebuggerTests.castToEnumTypeThatIsDefinedInExternalAssembly) 0;Error produced when we use this approach implies that we are missing the assembly with Enum type definition passed as reference to the script:
The type or namespace name 'DebuggerTests' could not be found (are you missing a using directive or an assembly reference?)",Adding pdbs that are stored in
DebugStore.assembliesto the Roslyn's script did not affect the error message, so I used the workaround of passing numeric value of enum instead.