forked from JavaTX/JavaCompilerCore
Kleine Änderung
This commit is contained in:
parent
6cf98f200b
commit
7c2f7c54dd
@ -435,11 +435,10 @@ public class BytecodeGenMethod implements StatementVisitor{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(Literal literal) {
|
public void visit(Literal literal) {
|
||||||
System.out.println(resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor()));
|
|
||||||
Object value = literal.value;
|
Object value = literal.value;
|
||||||
switch (resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor())) {
|
switch (resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor())) {
|
||||||
case "java/lang/String":
|
case "java/lang/String":
|
||||||
mv.visitLdcInsn((String) value);
|
mv.visitLdcInsn(value);
|
||||||
break;
|
break;
|
||||||
case "java/lang/Boolean":
|
case "java/lang/Boolean":
|
||||||
visitBooleanLiteral((Boolean) value);
|
visitBooleanLiteral((Boolean) value);
|
||||||
|
@ -132,6 +132,7 @@ public class Signature {
|
|||||||
break;
|
break;
|
||||||
case "TPH":
|
case "TPH":
|
||||||
RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType;
|
RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType;
|
||||||
|
if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH "))
|
||||||
sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature()));
|
sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature()));
|
||||||
// sv.visitClassType(r.acceptTV(new TypeToSignature()));
|
// sv.visitClassType(r.acceptTV(new TypeToSignature()));
|
||||||
System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature()));
|
System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature()));
|
||||||
|
@ -10,7 +10,7 @@ import java.lang.Character;
|
|||||||
|
|
||||||
class AssignToLit {
|
class AssignToLit {
|
||||||
void m(){
|
void m(){
|
||||||
String s = "String";
|
String s = "Test";
|
||||||
Boolean b = false;
|
Boolean b = false;
|
||||||
Byte byte1 = 5;
|
Byte byte1 = 5;
|
||||||
Byte byte2 = 55;
|
Byte byte2 = 55;
|
||||||
|
14
test/bytecode/Methods.jav
Normal file
14
test/bytecode/Methods.jav
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
class Methods {
|
||||||
|
|
||||||
|
m(a,b){
|
||||||
|
var c=a+b;
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
method2(x){
|
||||||
|
Integer i = this.m(x,2);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
7
test/bytecode/MethodsTest.java
Normal file
7
test/bytecode/MethodsTest.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
public class MethodsTest extends JavaTXCompilerTest {
|
||||||
|
public MethodsTest() {
|
||||||
|
this.fileName = "Methods";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user