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

Allows annonymous struct type to be passed as args #21703

Closed
2 tasks
XiaoPangxie732 opened this issue Jun 19, 2024 · 0 comments · Fixed by #22228
Closed
2 tasks

Allows annonymous struct type to be passed as args #21703

XiaoPangxie732 opened this issue Jun 19, 2024 · 0 comments · Fixed by #22228
Labels
Feature Request This issue is made to request a feature.

Comments

@XiaoPangxie732
Copy link

XiaoPangxie732 commented Jun 19, 2024

Describe the feature

Allows passing anonymous struct type where a method parameter requires a type

Use Case

For example the json decoding:

json_text := '{ "a": "b" }'
b := json.decode(struct {
	a string
}, json_text)!.a

there's no need to create a named struct type if the decoding of this type only exists here

Proposed Solution

No response

Other Information

https://discord.com/channels/592103645835821068/700746775962714232/1252377577083895919

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.6 58f4e12

Environment details (OS name and version, etc.)

V full version: V 0.4.6 30d6f7b.58f4e12
OS: windows, Microsoft Windows 11 רҵ�� v22631 64 λ
Processor: 12 cpus, 64bit, little endian,

getwd: xxx
vexe: E:\Programs\v\v.exe
vexe mtime: 2024-06-19 12:43:43

vroot: OK, value: E:\Programs\v
VMODULES: OK, value: C:\Users\xxx.vmodules
VTMP: OK, value: C:\Users\xxx\AppData\Local\Temp\v_0

Git version: git version 2.38.1.windows.1
Git vroot status: weekly.2023.24-2387-g58f4e126
.git/config present: true

CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.

thirdparty/tcc status: thirdparty-windows-amd64 a39eb79b

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@XiaoPangxie732 XiaoPangxie732 added the Feature Request This issue is made to request a feature. label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant