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

application-duality false alarm #268

Open
yegor256 opened this issue Jan 22, 2025 · 6 comments
Open

application-duality false alarm #268

yegor256 opened this issue Jan 22, 2025 · 6 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@yegor256
Copy link
Member

This is the code:

[] > foo
  a > @
    "first".as-bytes:0
    "second":1

The application-duality complains, but it shouldn't.

@yegor256 yegor256 added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Jan 22, 2025
@h1alexbel
Copy link
Contributor

@yegor256 I will take this

h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 22, 2025
h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 22, 2025
yegor256 added a commit that referenced this issue Jan 22, 2025
bug(#268): test for EO application-duality false alarm
@yegor256
Copy link
Member Author

@h1alexbel try this one:

[] > vertical-bound-method
  eq. > @
    if.
      true
      "second":1
      "first"
      .as-bytes:0
    "first"

@h1alexbel
Copy link
Contributor

@yegor256 currently it passes, is it expected right?

h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 22, 2025
@h1alexbel
Copy link
Contributor

h1alexbel commented Jan 22, 2025

@yegor256 too me it looks invalid, since if has three objects: two of them have @as (second, first), while true does not have @as, so that's why it should fail. WDYT?

@yegor256
Copy link
Member Author

@h1alexbel this is the code I have in runtime-tests.eo:

[] > vertical-bound-method
  eq. > @
    if.
      true
      "second":1
      "first"
      .as-bytes:0
    "first"

This is what prints:

[ERROR] org.eolang.runtime-tests:357 The anonymous object 
has duality in the application, which is prohibited (application-duality)

@yegor256
Copy link
Member Author

@h1alexbel this code is valid, if has only two arguments. This code is equivalent to:

[] > vertical-bound-method
  eq. > @
    true.if
      "second":1
      "first".as-bytes:0
    "first"

h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 26, 2025
h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 26, 2025
h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 26, 2025
h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 26, 2025
h1alexbel added a commit to h1alexbel/lints that referenced this issue Jan 28, 2025
yegor256 added a commit that referenced this issue Jan 28, 2025
bug(#268): allow vertical-bound-method in `application-duality`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants