Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer cannot find mutual recursion in objects nested inside some other object #19

Open
APotyomkin opened this issue Nov 13, 2021 · 0 comments

Comments

@APotyomkin
Copy link

Problematic code:

+package sandbox
+alias stdout org.eolang.io.stdout
+alias sprintf org.eolang.txt.sprintf

[] > foo
  [] > mutual_rec
    memory > x
    [self v] > f
      x.write > @
        v
    [self v] > g
      self.f > @
        self
        v

  [] > derived
    mutual_rec > @
    [self v] > f
      self.g > @
        self
        v

Steps to reproduce:

java -jar polystat-1.0-SNAPSHOT-jar-with-dependencies.jar sandbox temp

Expected results:

Mutual recursion is detected somehow

Actual output:

No errors
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[1]/o[2]/o[1]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[1]/o[2]/o[2]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[1]/o[3]/o[1]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[1]/o[3]/o[2]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[2]/o[2]/o[1]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
Warning
  XTDE0540: Ambiguous rule match for /objects/o[1]/o[2]/o[2]/o[2]
Matches both "element(Q{}o)[((empty(attribute::attribute(Q{}base))) and
  (exists(attribute::attribute(Q{}name)))) and
  ((data(parent::element(Q{}o)/attribute::attribute(Q{}line))) = data(@line))]" on line 53 of
and "element(Q{}o)[empty(attribute::attribute(Q{}base))]" on line 42 of
No errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant