Skip to content

Commit

Permalink
java.lang.AssertionError: cannot instantiate interface interface
Browse files Browse the repository at this point in the history
arb.functions.real.RealFunction
	at arb4j/arb.expressions.Expression.allocateIntermediateVariable(Expression.java:386)
	at arb4j/arb.expressions.nodes.VariableNode.generateReferenceToIndeterminantVariable(VariableNode.java:295)
	at arb4j/arb.expressions.nodes.VariableNode.generateReference(VariableNode.java:250)
	at arb4j/arb.expressions.nodes.VariableNode.generate(VariableNode.java:201)
	at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)
	at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)
	at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)
	at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)
	at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)
	at arb4j/arb.expressions.nodes.DerivativeNode.generate(DerivativeNode.java:139)
	at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:942)
	at arb4j/arb.expressions.Expression.generate(Expression.java:789)
	at arb4j/arb.expressions.Expression.defineClass(Expression.java:572)
	at arb4j/arb.expressions.Expression.getInstance(Expression.java:1220)
	at arb4j/arb.expressions.Expression.instantiate(Expression.java:1369)
	at arb4j/arb.functions.Function.instantiate(Function.java:126)
	at arb4j/arb.functions.Function.express(Function.java:89)
	at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:34)
	at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:21)
	at arb4j/arb.expressions.ExpressionTest.testRealFunctionDerivative(ExpressionTest.java:149)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)
	at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)
	at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)
	at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)
	at [email protected]/junit.framework.TestResult.run(TestResult.java:125)
	at [email protected]/junit.framework.TestCase.run(TestCase.java:130)
	at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)
	at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)
	at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)

 #253
  • Loading branch information
crowlogic committed Nov 28, 2024
1 parent f433501 commit ad33464
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/arb/expressions/Expression.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ public void addChecksForNullVariableReferences(MethodVisitor mv)
*/
public String allocateIntermediateVariable(MethodVisitor methodVisitor, Class<?> type)
{
assert !type.isInterface() : "cannot instantiate interface " + type;

String intermediateVariableName = newIntermediateVariable(type);
loadThisFieldOntoStack(methodVisitor, intermediateVariableName, type);
return intermediateVariableName;
Expand Down Expand Up @@ -1672,6 +1674,8 @@ public Expression<D, C, F> registerInitializer(Consumer<MethodVisitor> consumer)

public String registerIntermediateVariable(String intermediateVarName, Class<?> type, boolean initialize)
{
assert !type.isInterface() : "cannot instantiate interface " + type;

var newIntermediateVariable = new IntermediateVariable<>(this,
intermediateVarName,
type,
Expand Down
2 changes: 1 addition & 1 deletion todoList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ TODO: builtin sykbols for the classical orthogonal polynomials
"limit" is null at arb4j/arb.expressions.nodes.IntegralNode.evaluateIndefiniteIntegralAt(IntegralNode.java:217)
todo: mouse wheel zooms control or whole scene
expr compiler: fractional derivatices
java.lang.RuntimeException: unrecognized type interface arb.functions.real.RealFunctionat arb4j/arb.expressions.Compiler.getVariablePrefix(Compiler.java:342)at arb4j/arb.expressions.Expression.getNextIntermediateVariableFieldName(Expression.java:1243)at arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1517)at arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1497)at arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1492)at arb4j/arb.expressions.Expression.allocateIntermediateVariable(Expression.java:386)at arb4j/arb.expressions.nodes.VariableNode.generateReferenceToIndeterminantVariable(VariableNode.java:295)at arb4j/arb.expressions.nodes.VariableNode.generateReference(VariableNode.java:250)at arb4j/arb.expressions.nodes.VariableNode.generate(VariableNode.java:201)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)at arb4j/arb.expressions.nodes.DerivativeNode.generate(DerivativeNode.java:139)at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:940)at arb4j/arb.expressions.Expression.generate(Expression.java:787)at arb4j/arb.expressions.Expression.defineClass(Expression.java:570)at arb4j/arb.expressions.Expression.getInstance(Expression.java:1218)at arb4j/arb.expressions.Expression.instantiate(Expression.java:1367)at arb4j/arb.functions.Function.instantiate(Function.java:126)at arb4j/arb.functions.Function.express(Function.java:89)at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:34)at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:21)at arb4j/arb.expressions.ExpressionTest.testRealFunctionDerivative(ExpressionTest.java:149)at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)at java.base/java.lang.reflect.Method.invoke(Method.java:580)at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)at [email protected]/junit.framework.TestResult.run(TestResult.java:125)at [email protected]/junit.framework.TestCase.run(TestCase.java:130)at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)
java.lang.AssertionError: cannot instantiate interface interface arb.functions.real.RealFunctionat arb4j/arb.expressions.Expression.allocateIntermediateVariable(Expression.java:386)at arb4j/arb.expressions.nodes.VariableNode.generateReferenceToIndeterminantVariable(VariableNode.java:295)at arb4j/arb.expressions.nodes.VariableNode.generateReference(VariableNode.java:250)at arb4j/arb.expressions.nodes.VariableNode.generate(VariableNode.java:201)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:199)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:197)at arb4j/arb.expressions.nodes.DerivativeNode.generate(DerivativeNode.java:139)at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:942)at arb4j/arb.expressions.Expression.generate(Expression.java:789)at arb4j/arb.expressions.Expression.defineClass(Expression.java:572)at arb4j/arb.expressions.Expression.getInstance(Expression.java:1220)at arb4j/arb.expressions.Expression.instantiate(Expression.java:1369)at arb4j/arb.functions.Function.instantiate(Function.java:126)at arb4j/arb.functions.Function.express(Function.java:89)at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:34)at arb4j/arb.functions.real.RealFunctional.express(RealFunctional.java:21)at arb4j/arb.expressions.ExpressionTest.testRealFunctionDerivative(ExpressionTest.java:149)at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)at java.base/java.lang.reflect.Method.invoke(Method.java:580)at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)at [email protected]/junit.framework.TestResult.run(TestResult.java:125)at [email protected]/junit.framework.TestCase.run(TestCase.java:130)at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)

0 comments on commit ad33464

Please sign in to comment.