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
|
||||
public void visit(Literal literal) {
|
||||
System.out.println(resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor()));
|
||||
Object value = literal.value;
|
||||
switch (resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor())) {
|
||||
case "java/lang/String":
|
||||
mv.visitLdcInsn((String) value);
|
||||
mv.visitLdcInsn(value);
|
||||
break;
|
||||
case "java/lang/Boolean":
|
||||
visitBooleanLiteral((Boolean) value);
|
||||
|
@ -132,7 +132,8 @@ public class Signature {
|
||||
break;
|
||||
case "TPH":
|
||||
RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType;
|
||||
sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature()));
|
||||
if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH "))
|
||||
sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature()));
|
||||
// sv.visitClassType(r.acceptTV(new TypeToSignature()));
|
||||
System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature()));
|
||||
break;
|
||||
|
@ -10,7 +10,7 @@ import java.lang.Character;
|
||||
|
||||
class AssignToLit {
|
||||
void m(){
|
||||
String s = "String";
|
||||
String s = "Test";
|
||||
Boolean b = false;
|
||||
Byte byte1 = 5;
|
||||
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