Skip to content

Improve :file info type in stacktrace entries - #15892

Open
lukaszsamson wants to merge 2 commits into
elixir-lang:mainfrom
lukaszsamson:ls-stacktrace-type-improve
Open

lukaszsamson wants to merge 2 commits into
elixir-lang:mainfrom
lukaszsamson:ls-stacktrace-type-improve

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

This PR further improves type of file info in stacktrace by allowing nested chardata
Follow up to #15798

AssistedBy: Claude Fable 5.1

Comment thread lib/elixir/lib/module/types/apply.ex Outdated
chardata =
binary()
|> opt_union(empty_list())
|> opt_union(non_empty_list(term(), opt_union(binary(), empty_list())))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is accepting any term in the list. We probably need to define this as a recursive type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are recursive types mature enough to use them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'd say now is the perfect time to start!

Introduce scope param to recursive
Fix to_quoted on recursive types
@lukaszsamson

Copy link
Copy Markdown
Contributor Author

@josevalim recursive types would spin endlessly on to_quoted. I added a clause handling that. I also added scope param to recursive. Previously used make_ref() would not work with macro escaped signatures

@josevalim

Copy link
Copy Markdown
Member

Oh, I suppose we need to add pretty printing of recursive types first.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants