aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr/FieldAccess.java
diff options
context:
space:
mode:
authorakuznetsov <akuznetsov@tradingview.com>2023-12-29 17:29:28 +0400
committerakuznetsov <akuznetsov@tradingview.com>2023-12-29 17:29:28 +0400
commit9777bae93cc84249fe08a7e81b2101c415bd55e5 (patch)
tree64fb183df9171cf231e3429fa6248706d2af9105 /src/main/javassist/expr/FieldAccess.java
parent0824a7a04e2f5ca8acc355c2379cf625dadc8943 (diff)
downloadjavassist-9777bae93cc84249fe08a7e81b2101c415bd55e5.tar.gz
javassist-9777bae93cc84249fe08a7e81b2101c415bd55e5.zip
line numbers for undefined ids & more
Diffstat (limited to 'src/main/javassist/expr/FieldAccess.java')
-rw-r--r--src/main/javassist/expr/FieldAccess.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/javassist/expr/FieldAccess.java b/src/main/javassist/expr/FieldAccess.java
index 335314a5..9075e5fa 100644
--- a/src/main/javassist/expr/FieldAccess.java
+++ b/src/main/javassist/expr/FieldAccess.java
@@ -259,12 +259,12 @@ public class FieldAccess extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (args != null && !gen.isParamListName(args))
throw new CompileError(Javac.proceedName
- + "() cannot take a parameter for field reading");
+ + "() cannot take a parameter for field reading", lineNumber);
int stack;
if (isStatic(opcode))
@@ -282,14 +282,14 @@ public class FieldAccess extends Expr {
bytecode.add(opcode);
bytecode.addIndex(index);
bytecode.growStack(stack);
- gen.setType(fieldType);
+ gen.setType(fieldType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
- c.setType(fieldType);
+ c.setType(fieldType, lineNumber);
}
}
@@ -309,13 +309,13 @@ public class FieldAccess extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (gen.getMethodArgsLength(args) != 1)
throw new CompileError(Javac.proceedName
+ "() cannot take more than one parameter "
- + "for field writing");
+ + "for field writing", lineNumber);
int stack;
if (isStatic(opcode))
@@ -335,16 +335,16 @@ public class FieldAccess extends Expr {
bytecode.add(opcode);
bytecode.addIndex(index);
bytecode.growStack(stack);
- gen.setType(CtClass.voidType);
+ gen.setType(CtClass.voidType, lineNumber);
gen.addNullIfVoid();
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
c.atMethodArgs(args, new int[1], new int[1], new String[1]);
- c.setType(CtClass.voidType);
+ c.setType(CtClass.voidType, lineNumber);
c.addNullIfVoid();
}
}