-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[dart] Add support to dart's sound null safety #3114
Comments
Im not familiar with the code, and the change requires some deep knowledge of the codebase, so unfortunately I'm not able to do this myself. |
I have experience with Dart's sound null safety, and I'd be happy to take a stab at it if someone could point me in the direction of the Dart code generation. |
I've started to migrate but there is a lot of work to do. 246 errors to go: |
We have migrated both the runtime and the generated code to nndb on #3116. We can just figure out the test runner, which is weird. |
I guess @lingyv-li coukd help us with that? |
Although I replaced all occurrences of dart 2.8.4 to 2.12.1, I still get the following error when I run the runtime test suite:
Couldn't really figure out whats going on here. |
I did try to add sound nullsafety support too earlier, but it's a bit more tricky than I thought.
I'm glad to see contributions happening, ping me wherever I can help. |
Hey guys, I just wanted to create the same issue. I'm in the bad situation that I need to use If you guys need any additional support in flutter or the dart nullsafety, you could contact me here or on Twitter https://twitter.com/StefanSchalle10 . |
@stefanschaller Our PR is now passing all the Dart related tests, my project is now using antlr's version from our branch and is also working as expected. So, hopefully, we're getting closer.
I think that from this version onwards we should only support null-safety, otherwise we would also need two versions of the runtime, right? Since the whole ecosystem is moving to NNBD, i think its safe to say that from the current version onwards we only support a certain version of the dart SDK. Can you help us out with a review, the PR is huge and we (me an @renancaraujo) made some assumptions that might require some deeper knowledge on antlr's codebase. |
@canastro Thanks, I will try it out.
|
@canastro In my case, it generates code that is not compilable.
or:
Should I take care about something to fix this issue? Thanks. |
@stefanschaller I think you're using the correct runtime but not the correct cli to run the generator. You might need to clone the branch locally, build and add this (or something similar) to your bashrc file:
|
@canastro I don't get it, sorry. You mean, I should clone your repo? But is there a cli tool checked in, inside the repo? Thanks for your help. |
We also made changes to the generator, so you’ll need to use antlr by building our branch and using the jar that gets generated. The one you downloaded is a stable version that is already in master. ps: I’m not close to a computer, so I can’t give better instructions rn |
@stefanschaller you can follow this https://github.com/antlr/antlr4/blob/master/doc/building-antlr.md to build and generate the parser from the nnbd branch. I also think it's ok for us to drop support for older dart version, as the Dart target hasn't been around for too long. If anyone think otherwise, please comment. @canastro in this case can you please add some documentation mentioning the breaking change? Regarding the PR, it looks good to me at first glance. To be honest I don't understand all details of ANTLR, so it would be great if more people can try and test it out. |
And it's still not working. The generated code is the same and there are still null values etc. |
@lingyv-li : added the comment 👍🏽 @stefanschaller This is a piece of the generated code from my lexer:
We can continue on twitter DMs. |
@canastro Thank you so much for your support! Looks good and the code is working properly. Good job to everyone that is working on the branch. :D |
@lingyv-li can you point us who we should tag in the PR to make a thorough review? Or is there any maintainers chat that you can ping someone to help with the review? |
@ericvergnaud should be able to help when your PR is no longer WIP. (Since he reviewed the Dart target PR.) There might be a mailing list but not sure. |
Just removed the WIP tag on #3116, should be good to go! |
@lingyv-li This issue can be closed after we published a new version. The PR is already merged. |
May I ask when the new v4.9.3 will be released and also updated in https://pub.dev/packages/antlr4/versions ? Thanks everybody for your hard work on this! |
@parrt please close |
Since dart's SDK version 2.12.0, Sound null safety was added.
The SDK needs to be updated and the usage of nulls should be reviewed.
The text was updated successfully, but these errors were encountered: