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

cgen: add autofree comptime check #21197

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Apr 6, 2024

Add possibility to check if autofree is enabled.

$if autofree {

}

@felipensp felipensp marked this pull request as ready for review April 6, 2024 13:39
vlib/os/os.c.v Outdated Show resolved Hide resolved
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 d692d88 into vlang:master Apr 7, 2024
56 checks passed
@spytheman
Copy link
Member

There seems to be one problem:

println('start')

$if autofree {
    println('autofree was passed')
}
$if !autofree {
    println('no autofree')
}

$if abc ? {
    println('passed `-d abc`')
}

$if !abc ? {
    println('no `-d abc` passed')
}

println('done')

The no autofree case is never triggered for some reason.

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.

None yet

2 participants