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

checker: fix missing check for struct initialization with @[noinit] attribute through T{} usage #20516

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Jan 13, 2024

Fix #20508

import mod1

fn main() {
    dump(default_value[mod1.Foo]())
    println(default_value[mod1.Foo]())

    //a := mod1.Foo{}
}

fn default_value[T]() T {
	return T{}
}

@felipensp felipensp changed the title checker: fix missing check for struct with @[noinit] attribute checker: fix missing check for struct initialization with @[noinit] attribute through T{} usage Jan 13, 2024
@felipensp felipensp marked this pull request as ready for review January 13, 2024 12:18
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman spytheman merged commit ea6a5d8 into vlang:master Jan 13, 2024
54 checks passed
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.

Generics can initialize a noinit struct
2 participants