GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug] [AST->ASR] Result is ok even when there is an error in diagnostics · Issue #2810 · lcompilers/lpython

[Bug] [AST->ASR] Result is ok even when there is an error in diagnostics #2810

New issue
Copy link
New issue
Copy link
Open
Open
[Bug] [AST->ASR] Result is ok even when there is an error in diagnostics#2810
Copy link

Description

@ubaidsk
ubaidsk
opened on Sep 12, 2024
Issue body actions
(lp) ubaid@DESKTOP-TEN39M0:~/projects/lpython$ ./src/bin/lpython
Interactive LPython. Experimental prototype, not ready for end users.
LPython version: 0.22.0-53-g1ef4675ae
  * Use Ctrl-D to exit
  * Use Enter to submit
  * Use Alt-Enter or Ctrl-N to make a new line
    - Editing (Keys: Left, Right, Home, End, Backspace, Delete)
    - History (Keys: Up, Down)
>>> i: i32 = 5                                                                                                                                 1,11  ]
>>> from math import sin                                                                                                                       1,21  ]
>>> sin(i)                                                                                                                                     1,7   ]
>>>    

The above should have printed a semantic error like below:

semantic error: `x` argument of `Sin` must be real or complex
 --> input:1:5
  |
1 | sin(i)
  |     ^ 

But it does not print so. This issue is partially tackled in https://github.com/lcompilers/lpython/pull/2809/files, but I believe it is not the correct fix. We should ideally figure out why result is ok in the following even when there is an error present and rectify it.

if (res.ok) {
    r = res.result;
else {
    <code to print diagnostics is here>
}

PS: I think it is this PR lfortran/lfortran#3380 and the related ones where this issue of diagnostics message not showing up in interactive mode might have crept in.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.