Skip to content

cgen: fix interface type generation for generic struct - #22189

Merged
spytheman merged 6 commits into
vlang:masterfrom
felipensp:fix_interface_generic_2
Sep 14, 2024
Merged

spytheman merged 6 commits into
vlang:masterfrom
felipensp:fix_interface_generic_2

Conversation

@felipensp

Copy link
Copy Markdown
Member

Fix #22186

@StunxFS

StunxFS commented Sep 10, 2024 •

Copy link
Copy Markdown
Contributor

I think IB should necessarily be IB[T].

struct Foo[T] implements IA, IB[T] { 
         a int 
         b T 
 }

@felipensp
felipensp marked this pull request as ready for review September 10, 2024 10:56
@felipensp

Copy link
Copy Markdown
Member Author

I think IB should necessarily be IB[T].

struct Foo[T] implements IA, IB[T] { 
         a int 
         b T 
 }

What do you think @medvednikov ? This can be threated in another PR though.

@medvednikov

Copy link
Copy Markdown
Member

I agree, it should be struct Foo[T] implements IA, IB[T]

@felipensp

Copy link
Copy Markdown
Member Author

I agree, it should be struct Foo[T] implements IA, IB[T]

I've changed the implements_type to use TypeNode to save the token pos for checker error message.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent work.

@spytheman

Copy link
Copy Markdown
Contributor

Can I merge this now @felipensp , and then #22218 or ?

@spytheman
spytheman merged commit 5fcfc27 into vlang:master Sep 14, 2024
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.

C error when implementing two interfaces, one of them generic

4 participants