Open
Description
Description
Sometimes requirement inside of the cast function in the engine fails.
To Reproduce
Steps to reproduce the behavior:
- Create a project with following code:
public interface VirtualInvokeInterface<T1, T2> {
int narrowParameterTypeInInheritorObjectCast(T1 object);
int narrowParameterTypeInInheritorArrayCast(T2 object);
}
public class VirtualInvokeClass implements VirtualInvokeInterface<Integer, byte[]> {
@Override
public final int narrowParameterTypeInInheritorObjectCast(Integer object) {
if (object == null) {
return 0;
}
if (object == 1) {
return 1;
}
return object;
}
@Override
public final int narrowParameterTypeInInheritorArrayCast(byte[] object) {
if (object == null) {
return 0;
}
return object[0];
}
}
public class Example {
public int narrowParameterTypeInInheritorArrayCastExample(VirtualInvokeInterface<byte[], Integer> callee, Integer param) {
return callee.narrowParameterTypeInInheritorArrayCast(param);
}
public int narrowParameterTypeInInheritorObjectCastExample(VirtualInvokeInterface<byte[], Integer> callee, byte[] param) {
return callee.narrowParameterTypeInInheritorObjectCast(param);
}
}
- Run generation for
narrowParameterTypeInInheritorArrayCastExample
andnarrowParameterTypeInInheritorObjectCastExample
functions - Open the generated tests
Expected behavior
At least, the engine should not fail. Probably, I expect to have two branches in each example.
Actual behavior
Failed requirements in castObject
and castArray
function.
Visual proofs (screenshots, logs, images)
Environment
There is no specific environment.
Additional context
An initial problem occurred on the following line of code: String.format("%02d", intNumber)
Metadata
Metadata
Assignees
Type
Projects
Status
Todo