Daco Harkes
Daco Harkes
If you're using vscode: ```json { "name": "dart analyzer.dart", "type": "dart", "request": "launch", "program": "pkg/analyzer_cli/bin/analyzer.dart", "args": [ "tests/ffi/static_checks/vmspecific_static_checks_array_test.dart", ], "toolArgs": [], "enableAsserts": true, "cwd": "${workspaceFolder}", }, ``` For the transformation...
> ```dart > void main() { > final myStruct = Struct.create(); > myNative( > myStruct.a.address, > myStruct.b.address, // It expected to return Pointer, but it returning Pointer > ); >...
> But the tests in `tests/ffi/static_checks` contains the error annotations in code as comments, i would be surprised if those errors were written manually. And does those tests actually evaluated...
> > You run the test, and then it complains it expected a certain error string, and you paste the string in. 🙈 > > I thought this and imagined...
And on Windows apparently variable length can be size 1 (instead of 0). * https://github.com/dart-lang/native/issues/1200#issuecomment-2157897238
> In its current state, I can't use `@Array.variable()` in Win32 structs exposed in `package:win32` because `sizeOf` doesn't account for these fields. You mean you cannot use it at all,...
> I'm concerned that `calloc` not initializing these fields and `sizeOf` not taking them into account, could lead to some unexpected results. Right, I agree that this is a gotcha....
Awesome! ❤️ > I think I’ve covered everything, but I’d appreciate it if you could take a look to confirm that I didn’t miss anything. Let's kick off the CQ...
> I’m wondering if it might make sense to reformat those files in a separate CL first to make this one easier to review. Done (38e250b4d579b44b6418a30ae8fd6609e38f8824). Thanks for the suggestion!...
> (e.g. FFI currently produces code along the lines of `const [2, 4, 6](_abi())` - where `_abi()` is something the backend compiler consuming the AST will fold into a constant,...