Obsidian icon indicating copy to clipboard operation
Obsidian copied to clipboard

Static transaction code generation doesn't generate field

Open ReedOei opened this issue 5 years ago • 1 comments

The following passes the Obsidian compiler just fine, but the Java compiler gives out an error because the field out through which f is invoked does not get generated.

main contract X { 
    static transaction f() returns int {
        return 3;
    }   

    transaction g() returns int {
        return X.f();
    }   
}
:compileJava/chaincode/input/src/src/main/java/org/hyperledger/fabric/example/example/X.java:105: error: cannot find symbol
                return X.out.f(__st);

ReedOei avatar May 31 '19 21:05 ReedOei

You've encountered an unfortunate temporary special case in the compiler. We don't really have support for static transactions as you're asking for them.

mcoblenz avatar Jun 03 '19 18:06 mcoblenz