Skip to content

return all referenced types for typeDefinition #2246

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xdBronch
Copy link
Contributor

@xdBronch xdBronch commented Apr 11, 2025

this needs more (any) testing but just throwing it up for now, its quite possibly not too good! but i think the results can be pretty desirable.
closes #2052

@@ -5600,6 +5600,13 @@ fn addReferencedTypes(
},

.ip_index, .compile_error => {},
.either => {}, // TODO
.either => |either| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this feels too easy to work...

@@ -107,8 +107,8 @@ test "struct init" {

test "decl literal on generic type" {
try testDefinition(
\\fn Box(comptime T: type) type {
\\ return <tdef>struct</tdef> {
\\fn <tdef>Box</tdef>(comptime T: type) type {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this change desirable here?

try testDefinition(
\\const <tdef>A</tdef> = struct {};
\\const <tdef>B</tdef> = struct {};
\\fn fo<>o(_: A) B {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this fails, need to update the tests to work with array_of_DefinitionLink

@xdBronch xdBronch marked this pull request as draft April 11, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better typeDefiniton on functions
1 participant