Compilation error when accessing attributes without locator in the nested scope
Steps to reproduce
- Place the following code in
sandbox/eo/app.eo:
app.eo
+package sandbox
+alias stdout org.eolang.io.stdout
+alias sprintf org.eolang.txt.sprintf
[] > test
10 > c
[] > a
c > y
[args...] > app
stdout > @
sprintf
"Hello world"
- Compile it
Expected output
The program compiles successfully.
Actual output
Compiler log
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< org.eolang:quick-start >-----------------------
[INFO] Building quick-start 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ quick-start ---
[INFO] Deleting /usr/src/mymaven/target
[INFO]
[INFO] --- eo-maven-plugin:0.1.25:parse (default) @ quick-start ---
[INFO] 48 attributes loaded from 38 stream(s) in 52ms, 48 saved, 373 ignored: ["Agent-Class", "Ant-Version", "Archiver-Version", "Automatic-Module-Name", "Bnd-LastModified", "Build-Jdk", "Build-Jdk-Spec", "Built-By", "Bundl-version", "Bundle-Copyright", "Bundle-Description", "Bundle-DocURL", "Bundle-License", "Bundle-ManifestVersion", "Bundle-Name", "Bundle-RequiredExecutionEnvironment", "Bundle-SymbolicName", "Bundle-Vendor", "Bundle-Version", "Can-Redefine-Classes", "Can-Retransform-Classes", "Can-Set-Native-Method-Prefix", "Created-By", "EO-Version", "Eclipse-ExtensibleAPI", "Eclipse-SourceReferences", "Export-Package", "Extension-Name", "Implementation-Title", "Implementation-URL", "Implementation-Vendor", "Implementation-Vendor-Id", "Implementation-Version", "Import-Package", "Include-Resource", "JCabi-Build", "JCabi-Date", "JCabi-Version", "Main-Class", "Manifest-Version", "Multi-Release", "Premain-Class", "Project-Name", "Require-Capability", "Specification-Title", "Specification-Vendor", "Specification-Version", "Tool"]
[INFO] File /usr/src/mymaven/target/01-parse/app.eo.xml saved (1450 bytes)
[INFO] /usr/src/mymaven/eo/app.eo parsed to /usr/src/mymaven/target/01-parse/app.eo.xml
[INFO]
[INFO] --- eo-maven-plugin:0.1.25:optimize (default) @ quick-start ---
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/00-not-empty-atoms.xml saved (1499 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/01-middle-varargs.xml saved (1535 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/02-duplicate-names.xml saved (1572 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/03-many-free-attributes.xml saved (1614 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/04-broken-aliases.xml saved (1650 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/05-duplicate-aliases.xml saved (1689 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/06-one-body.xml saved (1719 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/07-same-line-names.xml saved (1756 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/08-self-naming.xml saved (1789 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/09-add-refs.xml saved (1827 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/10-wrap-method-calls.xml saved (1866 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/11-vars-float-up.xml saved (1901 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/12-add-refs.xml saved (1931 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/13-resolve-aliases.xml saved (1968 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/14-resolve-aliases.xml saved (2034 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/15-add-default-package.xml saved (2097 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/16-broken-refs.xml saved (2130 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/17-unknown-names.xml saved (2165 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/18-noname-attributes.xml saved (2204 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/19-duplicate-names.xml saved (2241 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/20-data-objects.xml saved (2275 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/21-globals-to-abstracts.xml saved (2317 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/22-remove-refs.xml saved (2342 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/23-abstracts-float-up.xml saved (2663 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/24-remove-levels.xml saved (2698 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/25-add-refs.xml saved (2746 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/26-fix-missed-names.xml saved (2784 bytes)
[INFO] File /usr/src/mymaven/target/02-steps/app.eo.xml/27-broken-refs.xml saved (2817 bytes)
[INFO] File /usr/src/mymaven/target/03-optimize/app.eo.xml saved (2817 bytes)
[INFO] /usr/src/mymaven/target/01-parse/app.eo.xml optimized to /usr/src/mymaven/target/03-optimize/app.eo.xml, all steps are in /usr/src/mymaven/target/02-steps/app.eo.xml
[INFO]
[INFO] --- eo-maven-plugin:0.1.25:compile (default) @ quick-start ---
[INFO] Gen directory created: /usr/src/mymaven/target/generated-sources
[INFO] /usr/src/mymaven/target/05-compile directory created
[INFO] /usr/src/mymaven/target/04-pre directory created
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/00-pre-classes.xml saved (2890 bytes)
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/01-pre-junit.xml saved (2921 bytes)
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/02-pre-attrs.xml saved (3434 bytes)
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/03-pre-varargs.xml saved (3471 bytes)
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/04-pre-arrays.xml saved (3503 bytes)
[INFO] File /usr/src/mymaven/target/04-pre/app.eo.xml/05-pre-data.xml saved (3659 bytes)
You must explicitly say "^.c" instead of just "c" on line 8
[ERROR] #fatalError(): Processing terminated by xsl:message at line 282 in file:///; SystemID: file:///; Line#: 282
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.902 s
[INFO] Finished at: 2021-06-29T13:39:38Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eolang:eo-maven-plugin:0.1.25:compile (default) on project quick-start: Execution default of goal org.eolang:eo-maven-plugin:0.1.25:compile failed: failed to transform by net.sf.saxon.TransformerFactoryImpl: Processing terminated by xsl:message at line 282 in file:/// -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
ERROR: 1
Analysis
Looks like access to c in the nested object test.a breaks the compiler, because when it is removed or when locator ^ is specified - the program compiles successfully.
The case looks even stranger, when trying to run the following program (example from paper):
Program
+package sandbox
+alias stdout org.eolang.io.stdout
+alias sprintf org.eolang.txt.sprintf
[child height] > shape
[] > volume
child.square.mul ^.height
[height r] > circle
memory r > radius
shape $ height > @
[] > square
3.14.mul
radius.mul
radius
[args...] > app
stdout > @
sprintf
"Hello world"
Because the program compiles successfully, even though it contains references to the upper level objects without an explicit locator in an inner object (circle.square references circle.radius relatively).
I can't understand why the behavior is as described, so I am submitting this issue in order to figure out what's happening.
@Sitiritis definitely something is wrong here, thanks for reporting
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@yegor256/z everybody who has role DEV is banned at #307; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@mximp please help
I've repeated the steps in the description and the code has successfully compiled.
Current version of eo-maven-plugin (which I used):
[INFO] --- eo-maven-plugin:0.23.19:transpile (default) @ sandbox ---
The version in the description is:
[INFO] --- eo-maven-plugin:0.1.25:compile (default) @ quick-start ---
which is quite behind the current one.
Also both snippets in the description contains double line carriage which is not compilable with current version of the plugin.
@Sitiritis @yegor256 If the issue cannot be reproduced with new version of the plugin and corrected code - I suggest to close it.
@Sitiritis @yegor256 please check comment above
@yegor256 @Sitiritis if there are still issues?
@yegor256 @Sitiritis reminder
@Sitiritis I'm closing. if any more similar issues, please open a new ticket