Missing symbols from Java codegen
See original GitHub issueSteps to reproduce:
git clone -b logic_for_observers2 git@github.com:digital-asset/contingent-claims.git
cd contingent-claims
git submodule init && git submodule update
mkdir -p src/main/java && mkdir target
sed -i '0,/^\([[:space:]]*sdk-version: *\).*/s//\12.0.0/;' daml.yaml
daml build
daml codegen java .daml/dist/contingent-claims-0.0.1.dar -o src/main/java
cs fetch com.daml:bindings-java:2.0.0
javac \
-cp ~/.cache/coursier/v1/https/repo1.maven.org/maven2/com/daml/bindings-java/2.0.0/bindings-java-2.0.0.jar \
-d target -sourcepath src/main/java @<(find src/main/java -name "*.java")
This will cause the following errors to be reported:
src/main/java/contingentclaims/claim/serializable/claimf/ScaleF.java:33: error: cannot find symbol
fields.add(new DamlRecord.Field("k", this.k.toValue(v$0 -> toValuet.apply(v$0),v$1 -> new Numeric(v$1))));
^
symbol: variable toValuet
location: class ScaleF<t,a,x>
where t,a,x are type-variables:
t extends Object declared in class ScaleF
a extends Object declared in class ScaleF
x extends Object declared in class ScaleF
src/main/java/contingentclaims/claim/serializable/claimf/ScaleF.java:49: error: cannot find symbol
Observation<t, BigDecimal> k = Observation.<t, java.math.BigDecimal>fromValue(fields$.get(0).getValue(), v$0 -> fromValuet.apply(v$0), v$1 -> v$1.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected k to be of type com.daml.ledger.javaapi.data.Numeric")).getValue());
^
symbol: variable fromValuet
location: class ScaleF<t,a,x>
where t,a,x are type-variables:
t extends Object declared in class ScaleF
a extends Object declared in class ScaleF
x extends Object declared in class ScaleF
src/main/java/contingentclaims/observation/observation/DecimalNeg.java:25: error: cannot find symbol
return new Variant("DecimalNeg", this.observationValue.toValue(v$0 -> toValuet.apply(v$0),v$1 -> new Numeric(v$1)));
^
symbol: variable toValuet
location: class DecimalNeg<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalNeg
a extends Object declared in class DecimalNeg
src/main/java/contingentclaims/observation/observation/DecimalNeg.java:32: error: cannot find symbol
Observation<t, BigDecimal> body = Observation.<t, java.math.BigDecimal>fromValue(variantValue$, v$0 -> fromValuet.apply(v$0), v$1 -> v$1.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue());
^
symbol: variable fromValuet
location: class DecimalNeg<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalNeg
a extends Object declared in class DecimalNeg
src/main/java/contingentclaims/observation/observation/DecimalMul.java:26: error: cannot find symbol
return new Variant("DecimalMul", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalMul<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalMul
a extends Object declared in class DecimalMul
src/main/java/contingentclaims/observation/observation/DecimalMul.java:26: error: cannot find symbol
return new Variant("DecimalMul", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalMul<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalMul
a extends Object declared in class DecimalMul
src/main/java/contingentclaims/observation/observation/DecimalMul.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalMul<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalMul
a extends Object declared in class DecimalMul
src/main/java/contingentclaims/observation/observation/DecimalMul.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalMul<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalMul
a extends Object declared in class DecimalMul
src/main/java/contingentclaims/observation/observation/DecimalLte.java:26: error: cannot find symbol
return new Variant("DecimalLte", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalLte<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalLte
a extends Object declared in class DecimalLte
src/main/java/contingentclaims/observation/observation/DecimalLte.java:26: error: cannot find symbol
return new Variant("DecimalLte", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalLte<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalLte
a extends Object declared in class DecimalLte
src/main/java/contingentclaims/observation/observation/DecimalLte.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalLte<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalLte
a extends Object declared in class DecimalLte
src/main/java/contingentclaims/observation/observation/DecimalLte.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalLte<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalLte
a extends Object declared in class DecimalLte
src/main/java/contingentclaims/observation/observation/DecimalEqu.java:26: error: cannot find symbol
return new Variant("DecimalEqu", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalEqu<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalEqu
a extends Object declared in class DecimalEqu
src/main/java/contingentclaims/observation/observation/DecimalEqu.java:26: error: cannot find symbol
return new Variant("DecimalEqu", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalEqu<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalEqu
a extends Object declared in class DecimalEqu
src/main/java/contingentclaims/observation/observation/DecimalEqu.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalEqu<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalEqu
a extends Object declared in class DecimalEqu
src/main/java/contingentclaims/observation/observation/DecimalEqu.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalEqu<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalEqu
a extends Object declared in class DecimalEqu
src/main/java/contingentclaims/observation/observation/DecimalAdd.java:26: error: cannot find symbol
return new Variant("DecimalAdd", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalAdd<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalAdd
a extends Object declared in class DecimalAdd
src/main/java/contingentclaims/observation/observation/DecimalAdd.java:26: error: cannot find symbol
return new Variant("DecimalAdd", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalAdd<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalAdd
a extends Object declared in class DecimalAdd
src/main/java/contingentclaims/observation/observation/DecimalAdd.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalAdd<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalAdd
a extends Object declared in class DecimalAdd
src/main/java/contingentclaims/observation/observation/DecimalAdd.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalAdd<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalAdd
a extends Object declared in class DecimalAdd
src/main/java/contingentclaims/observation/observation/DecimalDiv.java:26: error: cannot find symbol
return new Variant("DecimalDiv", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalDiv<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalDiv
a extends Object declared in class DecimalDiv
src/main/java/contingentclaims/observation/observation/DecimalDiv.java:26: error: cannot find symbol
return new Variant("DecimalDiv", this.tuple2Value.toValue(v$0 -> v$0.toValue(v$1 -> toValuet.apply(v$1),v$2 -> new Numeric(v$2)),v$3 -> v$3.toValue(v$4 -> toValuet.apply(v$4),v$5 -> new Numeric(v$5))));
^
symbol: variable toValuet
location: class DecimalDiv<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalDiv
a extends Object declared in class DecimalDiv
src/main/java/contingentclaims/observation/observation/DecimalDiv.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalDiv<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalDiv
a extends Object declared in class DecimalDiv
src/main/java/contingentclaims/observation/observation/DecimalDiv.java:33: error: cannot find symbol
Tuple2<Observation<t, BigDecimal>, Observation<t, BigDecimal>> body = Tuple2.<contingentclaims.observation.Observation<t, java.math.BigDecimal>, contingentclaims.observation.Observation<t, java.math.BigDecimal>>fromValue(variantValue$, v$0 -> Observation.<t, java.math.BigDecimal>fromValue(v$0, v$1 -> fromValuet.apply(v$1), v$2 -> v$2.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()), v$3 -> Observation.<t, java.math.BigDecimal>fromValue(v$3, v$4 -> fromValuet.apply(v$4), v$5 -> v$5.asNumeric().orElseThrow(() -> new IllegalArgumentException("Expected body to be of type com.daml.ledger.javaapi.data.Numeric")).getValue()));
^
symbol: variable fromValuet
location: class DecimalDiv<t,a>
where t,a are type-variables:
t extends Object declared in class DecimalDiv
a extends Object declared in class DecimalDiv
24 errors
Support case: https://digitalasset1.lightning.force.com/lightning/r/Case/5004x00000AZaYTAA1/view
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
[JAVA] Jackson innerEnum missing JsonValue symbol #8724
Description When using io.swagger:swagger-codegen-cli:2.3.1 from maven, get build issues for models with an inner enum.
Read more >How to Resolve The Cannot Find Symbol Error in Java - Rollbar
The cannot find symbol error refers to a situation where the Java compiler is unable to find the symbol associated with a given...
Read more >swagger-codegen simple models missing - Stack Overflow
I'm realizing my second API with swagger/swagger-codegen. ... The generated TopIssueReference class is the following (in java):
Read more >What Causes “Cannot find symbol” Compilation Error in Java?
Java Cannot find symbol error is a commonly occurring error in the Java compilation process. Find out its causes and ways to resolve...
Read more >Symbol (Smithy API 1.8.0)
java.lang.Object. software.amazon.smithy.codegen.core.Symbol. All Implemented Interfaces: SymbolContainer , SymbolDependencyContainer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe you’re mistaken.
configureCodeGenScope
makes aSeq[Interface]
from alldarFiles
and anEnvironmentInterface
from that (all as intended), and finds the dependencies from that.@matevarga-da #13658 follows up the above with a fix to the original noncompiling code, so it will work regardless of whether
ClaimF
is used in a template.