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

No_Such_Method.Error cannot be displayed on types that overloaded to_display_text #6297

Closed
radeusgd opened this issue Apr 15, 2023 · 2 comments
Labels
--bug Type: bug -compiler -libs Libraries: New libraries to be implemented

Comments

@radeusgd
Copy link
Member

Related to #6216 / #1538.

Repro

Run:

from Standard.Base import all
from Standard.Table import Value_Type

main =
    Value_Type.nonexistent

Expected result

Execution finished with an error: Method `nonexistent` of Value_Type could not be found.
        at <enso> errorinerror.main(errorinerror.enso:5:...)

Actual result

Execution finished with an error: Type error: expected `str` to be Text, but got Function.
        at <enso> No_Such_Method.to_display_text<arg-0>(C:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Base\0.0.0-dev\src\Errors\Common.enso:164:28-90)
        at <enso> No_Such_Method.to_display_text(C:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Base\0.0.0-dev\src\Errors\Common.enso:164:28-113)
        at <enso> errorinerror.main(Internal)

The No_Such_Method.Error that is raised cannot be displayed, because it calls to_display_text on Value_Type. Since that method is overridden to provide nicer display for instances of Value_Type, this call yields Value_Type.type.to_display_text[Value_Type.enso:280-611] instead of Value_Type as we'd expect.

@radeusgd radeusgd added --bug Type: bug -compiler -libs Libraries: New libraries to be implemented triage labels Apr 15, 2023
@JaroslavTulach JaroslavTulach added this to the Design Partners milestone Apr 18, 2023
@JaroslavTulach
Copy link
Member

I'd start by implementing

and then checked the result on this issue.

@jdunkerley
Copy link
Member

Will be solved by #6300 so closing.

@jdunkerley jdunkerley closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler -libs Libraries: New libraries to be implemented
Projects
Archived in project
Development

No branches or pull requests

3 participants