-
Notifications
You must be signed in to change notification settings - Fork 5
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
Build and run with macros for e2e testing #80
Comments
It looks like we currently don't support both declaring the constructor and augmenting it within the same class body. Is this blocking you? |
Hmmmm. Confirmed if I split the augmentation file in two it works:
but then, how is it that it works if it's a macro generating the same augmentation with clashing external+augment? Perhaps it's to do with the output being evaluated phase by phase instead of in one shot from the file? Whether I'm blocked / how high priority this is, is a good question :) ... I'm trying to use the CFE to test the output from the analyzer on one particular macro, I think I can reasonably work around it and focus on other things for now by putting the Thanks. |
Yeah, that seems to work okay--will aim to land an e2e test with that workaround tomorrow, hopefully that gets us enough scope to work on json_codable that we have plenty to do for a while :) |
There seems to be a similar issue with methods but with a different symptom, approximately, the CFE can run this if it's macro output:
but if I supply it as a file on disk I get an error that doesn't make sense:
workaround is the same, move the |
Hi @johnniwinther, I'm running into what I think might be a CFE issue, could you take a look please?
What I'm trying to do is to take the code output by a new
dart_model
macro, dump it to disk, then run it with the CFE. So from the CFE's point of view they are "just" augmentations; the only weird point is that I have to explicitly add theimport augment
that the CFE would add invisibly when running as a macro.What I think I see is that the CFE-generated augmentation works but the equivalent augmentation without macros doesn't.
All the files below are in this draft PR.
So this works (with CFE build at head today):
Looking at this code in the debugger I can see the augmentations that get produced:
and then my equivalent
dart_model
macro produces something very similar, and trying to run (which means adding an explicitimport augment
) it I end up with this on disk:but running it fails:
I tried using
file
references instead of package references in this code, but it doesn't seem to make any difference.Any ideas, please?
I realize that using "external" in this way is probably not what we want in the end, so if there is some newer/better recommended way then that's good too :)
Thanks.
The text was updated successfully, but these errors were encountered: