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

Unable to access constructor value in interactive mode #7184

Closed
4e6 opened this issue Jul 3, 2023 · 13 comments · Fixed by #8626
Closed

Unable to access constructor value in interactive mode #7184

4e6 opened this issue Jul 3, 2023 · 13 comments · Fixed by #8626
Assignees

Comments

@4e6
Copy link
Contributor

4e6 commented Jul 3, 2023

Issue

In the interactive mode, when trying to create a node with a type getter, it returns an error that the method is not available. The issue only affects the nodes created after the project is started.

How to reproduce

  • Open the Unnamed project in the IDE Unnamed.zip
    from Standard.Base import all
    from Standard.Table import all
    import Standard.Visualization
    
    type Student
       Value id region
    
    main =
       operator1 = Student.Value 1 'EAST'
       operator2 = operator1.id
       operator2
  • Create a new node operator1.id

Expected result

Node evaluates to a value

Actual result

Node evaluates to an error:

Method `id` of type Student could not be found
issue-type-accessor.mp4
@radeusgd
Copy link
Member

radeusgd commented Jul 4, 2023

This looks like duplicate of #5249, but good that you reported it because it apparently got unscheduled.

@hubertp hubertp added the p-low Low priority label Jul 6, 2023
@hubertp
Copy link
Collaborator

hubertp commented Jul 6, 2023

This was demoted for now, since users cannot define their own types (intuitively) in the project currently (other than the editor but that is not what we want).

@jdunkerley jdunkerley assigned 4e6 and unassigned hubertp Oct 10, 2023
@jdunkerley jdunkerley moved this from 📤 Backlog to ❓New in Issues Board Oct 10, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Oct 10, 2023
@radeusgd
Copy link
Member

radeusgd commented Dec 9, 2023

Hitting that issue again when doing Advent of Code - I tried defining my custom types and I cannot really define functions on them as that simply does not work:
image

I also cannot rely on customizing to_display_text on such types, because it is not picked up either.

@jdunkerley
Copy link
Member

Possibly related to #8505

@enso-bot
Copy link

enso-bot bot commented Dec 15, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-15):

Progress: Started working on the task. Was finishing the task with the compiler error on a duplicate self argument. Started working on the test case reproducing the scenario. It should be finished by 2023-12-21.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@4e6 4e6 moved this from 📤 Backlog to 🔧 Implementation in Issues Board Dec 15, 2023
@enso-bot
Copy link

enso-bot bot commented Dec 19, 2023

Dmitry Bushev reports a new STANDUP for yesterday (2023-12-18):

Progress: continue working on the task. Was trying to reproduce the issue with the test scenario. Was not able to prepare the test. Although the issue can be reproduced in gui with the same scenario. It should be finished by 2023-12-21.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Dec 19, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-19):

Progress: continue working on the task. Started debugging the case in gui. Found that after the text edit, the runtime contains a type constructor with the wrong reference to the type. Might be related to caching. It should be finished by 2023-12-21.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Dec 20, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-20):

Progress: continue working on the task. It has to do something with how atoms and atom constructors in particular are registered in the scope. It feels like they are some kind of singletons, and their scope is not updated during the program re-execution. It should be finished by 2023-12-21.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Dec 22, 2023

Dmitry Bushev reports a new STANDUP for yesterday (2023-12-21):

Progress: continue working on the task. Figured out that the method resolution fails because the resulting atom is cached. The cached atom contains a reference to an old type. This type is then used to resolve a method in an updated scope and the resolution fails. It should be finished by 2023-12-21.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Dec 22, 2023

Dmitry Bushev reports a new 🔴 DELAY for today (2023-12-22):

Summary: There is 5 days delay in implementation of the Unable to access constructor value in interactive mode (#7184) task.
It will cause 5 days delay for the delivery of this weekly plan.

Delay Cause: This issue was quite tricky to identify and debug. Now the cause is clear. It will take a couple more days to implement a fix and test everything.

@enso-bot
Copy link

enso-bot bot commented Dec 22, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-22):

Progress: Continue working on the task. Implemented the fix when the type information is retained between the compilations. Started working on the case when the type is changed and the engine state needs to be properly invalidated. It should be finished by 2023-12-26.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Dec 25, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-25):

Progress: Continue working on the task. Implemented the tests to check the caches. Updated the cache invalidation logic during the interactive compilation to invalidate the nodes that depend on the resolution errors. Started testing It should be finished by 2023-12-26.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@4e6 4e6 moved this from 🔧 Implementation to 👁️ Code review in Issues Board Dec 26, 2023
@enso-bot
Copy link

enso-bot bot commented Dec 26, 2023

Dmitry Bushev reports a new STANDUP for today (2023-12-26):

Progress: Continue working on the task. Finished the testing. Tweaked the cached invalidation logic a bit. Cleaned up, added the docs, and undrafted the PR. It should be finished by 2023-12-26.

Next Day: Next day I will be working on the #7184 task. Continue working on the task

@mergify mergify bot closed this as completed in #8626 Jan 3, 2024
mergify bot pushed a commit that referenced this issue Jan 3, 2024
close #7184

The constructor value was not accessible because during the re-compilation a new instance of the type was registered in runtime. Then during the execution, an old cached instance of the type was used in method resolution.

Changelog:
- update: the registration of types in runtime
- update: invalidate cached nodes that became a resolution error after applying the edit
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants