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

close(File) and setFilePos(File, int64, ...) can be used in func #22166

Closed
tersec opened this issue Jun 27, 2023 · 0 comments · Fixed by #23380
Closed

close(File) and setFilePos(File, int64, ...) can be used in func #22166

tersec opened this issue Jun 27, 2023 · 0 comments · Fixed by #23380

Comments

@tersec
Copy link
Contributor

tersec commented Jun 27, 2023

Description

func closeFile(file: File) = close(file)
func seekFile(file: File, pos: int64) = setFilePos(file, pos)

closeFile(default(File))
seekFile(default(File), 0)

These depend on the state of the filesystem, and close might trigger actual filesystem writes. Neither is free of side-effects.

Nim Version

Nim Compiler Version 1.9.5 [Linux: amd64]
Compiled at 2023-06-26
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 4546f5dfe539ff4f37a5100bdfedaf4867293f3a
active boot switches: -d:release

Current Output

Compiles.

Expected Output

Does not compile.

Possible Solution

No response

Additional Information

No response

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 a pull request may close this issue.

1 participant