-
Notifications
You must be signed in to change notification settings - Fork 87
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
uninitialized model throws: Attempt to execute code removed by Dart AOT compiler (TFA) when compiled to exe #1415
Comments
Related to dart-lang/sdk#52874 Dont make the product final. Make it nullable
|
Hello @milindgoel15, thanks for the comment. I already worked around it by using "late" But really, I don't want to make it nullable when it's not, and I don't want to use "late" and lose the static analysis/lints, and obviously I don't want it to be dynamic. I just thought it would be nice for this particular case to be solved. Thanks anyway. |
You could do ternary check instead of assigning them in the if else.
|
Huh, clever! Unfortunately my actual code is a bit more complicated than a simple boolean check. Will try to make it work tho, thanks! |
If its a state, perhaps try https://riverpod.dev/, maybe a stream as then you can avoid nullable via an empty stream |
There was a number of dart compiler bugs introduced with Dart 3 in relation to classes marked |
What happened?
I need to have an uninitialized model (let's call it
Product
) like this:the problem appears when I compile the app using
dart compile exe ...
and run it, it throws that error:Attempt to execute code removed by Dart AOT compiler (TFA)
Notes:
Product
final prod = Product('prod');
)final prod;
for example)I think I can work around it for now, I am just hoping this would get fixed 😀
if this not the appropriate place for this issue please guide me
Repro steps
dart create dummy_project
dart pub add realm_dart
dart run realm_dart install
lib/model.dart
with the following contents:Version
Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "linux_x64"
What Atlas Services are you using?
Local Database only
What type of application is this?
Dart standalone application
Client OS and version
OS: openSUSE Tumbleweed x86_64
Code snippets
Stacktrace of the exception/crash you're getting
Relevant log output
No response
The text was updated successfully, but these errors were encountered: