We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
__getattr__()
__setattr__()
When you declare __getattr__[]() with a parametric key, then using __setattr__() for that same type will give:
__getattr__[]()
error: invalid call to 'setattr': missing 1 required positional argument: 'key'
@value struct MyType: fn __getattr__[key: StringLiteral](self) -> Int: return 0 fn __setattr__(inout self, key: StringLiteral, value: Int): pass fn main(): var t = MyType() t.a = 1
Host Information ================ Target Triple: x86_64-unknown-linux CPU: skylake CPU Features: adx, aes, avx, avx2, bmi, bmi2, clflushopt, cmov, crc32, cx16, cx8, f16c, fma, fsgsbase, fxsr, invpcid, lzcnt, mmx, movbe, pclmul, popcnt, prfchw, rdrnd, rdseed, sahf, sgx, sse, sse2, sse3, sse4.1, sse4.2, ssse3, x87, xsave, xsavec, xsaveopt, xsaves mojo 2024.7.3108 (ca019713) modular 0.8.0 (39a426b5)
The text was updated successfully, but these errors were encountered:
Regardless of whether or not the __setattr__() is parametric.
Sorry, something went wrong.
No branches or pull requests
Bug description
When you declare
__getattr__[]()
with a parametric key, then using__setattr__()
for that same type will give:Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: