Open
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1136 tests passing in 63 suites. Report generated by 🧪jest coverage report action from 2a2cc0b |
1001mei
reviewed
Feb 8, 2025
Comment on lines
+213
to
+215
| if (areClassTypesCompatible(fromType, toType) || fromType === '') { | ||
| return 0; | ||
| } |
Contributor
There was a problem hiding this comment.
When will fromType be empty?
Comment on lines
+768
to
+772
| const methodInfo = symbolInfos[symbolInfos.length - 1] as MethodInfos | ||
| if (!methodInfo || methodInfo.length === 0) { | ||
| throw new Error(`No method information found for ${n.identifier}`) | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
perhaps can rename methodInfo to methodInfos, then can remove the methodInfos in line 796 to remove duplication
Comment on lines
+773
to
+789
| const fullDescriptor = methodInfo[0].typeDescriptor // Full descriptor, e.g., "(Ljava/lang/String;C)V" | ||
| const paramDescriptor = fullDescriptor.slice(1, fullDescriptor.indexOf(')')) // Extract "Ljava/lang/String;C" | ||
| const params = paramDescriptor.match(/(\[+[BCDFIJSZ])|(\[+L[^;]+;)|[BCDFIJSZ]|L[^;]+;/g) | ||
|
|
||
| // Parse individual parameter types | ||
| if (params && params.length !== n.argumentList.length) { | ||
| throw new Error( | ||
| `Parameter mismatch: expected ${params?.length || 0}, got ${n.argumentList.length}` | ||
| ) | ||
| } | ||
|
|
||
| n.argumentList.forEach((x, i) => { | ||
| const argCompileResult = compile(x, cg) | ||
| maxStack = Math.max(maxStack, i + 1 + argCompileResult.stackSize) | ||
|
|
||
| const expectedType = params?.[i] // Expected parameter type | ||
| const stackSizeChange = handleImplicitTypeConversion(argCompileResult.resultType, expectedType ?? '', cg) | ||
| maxStack = Math.max(maxStack, i + 1 + argCompileResult.stackSize + stackSizeChange) |
Contributor
There was a problem hiding this comment.
i assume your scope are not supporting method overloading? otherwise might have issues of converting type unnecessary because here it's always converted to match the first method in methodInfo array.
| cg.code.push(typeConversionsImplicit[conversionKeyRight]) | ||
| finalType = 'D'; | ||
| } else if (leftType !== 'F' && rightType === 'F') { | ||
| // handleImplicitTypeConversion(leftType, 'F', cg); |
Contributor
There was a problem hiding this comment.
can remove this commented out line~
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #56