-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't serve web project with 2.19 #51128
Comments
@jakemac53 ? @natebosch ? |
I can repro this on |
I also don't see any recent changes to the failing line of code so I am pretty confused by why this error is showing up |
weirdly it doesn't happen with
I can't use The Really tuff to make Angular compiler compatible with it :/ |
I confirmed that the language version change from I also confirmed with a minimal reproduction that the Here is a minimal repro: T? inferFromArgs<T>(
T Function(List<int>) fromBytes, List<int> Function(T) toBytes) =>
null;
final x = inferFromArgs(String.fromCharCodes, (m) => m.codeUnits);
void main() {} This runs without error on the following language/SDK combinations:
What seems to throw off the analyzer (in both SDKs) and CFE (in @stereotype441 - can you confirm that this is intended to be a static error for language version earlier than 2.18? |
@natebosch thanks for the minimal repro. It's not immediately clear to me what's going on here. I will set aside some time tomorrow to dig into this. |
Note that in general, if you can't upgrade your analyzer, then you probably don't want to upgrade your SDK either. The analyzer version you have may not fully support the language changes in the SDK. |
@jakemac53 you are correct, that is why we are migrating to analyzer 5.4.0 now. (However we stumbled upon another weird error: dart-lang/build#3444) |
I dug into @natebosch's minimal repro a bit, and I believe it is correct (according to the language spec) to report an error when the language version is I also figured out why the analyzer is failing to report an error, and wrote up a separate issue for it: #51137 What I don't know is why the front end only reports the error with version 2.19.0, and not with 2.18.0. @johnniwinther or @chloestefantsova, would one of you mind having a look into why the front end behaviour changed? |
I am closing this issue because we were able to migrate our Angular projects and 2.19 is working ok. |
@jodinathan I'm glad to hear that you were able to get your projects to work. I'm going to go ahead and re-open this issue, because as @natebosch pointed out in #51128 (comment), we do have a difference between the behaviour of the front end between versions 2.18 and 2.19, and I think it would be good for us to figure out why the behaviour differs, make sure the current behaviour is what we want, and (if necessary) make a retroactive breaking-change announcement to help out others who run into the same issue you did. |
@jakemac53 When digging into this issue in dart-lang/build#3412, I noticed that build_modules raised its SDK constraint from 2.14 to 2.18 in 4.0.7, opting that package into the newer language version. I wonder if that explains why the behavior is different between 4.0.6 and 4.0.7? |
Correct, there was a change to inference that broke the package. Bumping the language version fixed that issue. |
How did you manage to resolve this? Because I'm also having this problem with AngularDart 7.1.1 and Dart 2.19.5 name: new_sali_frontend
environment:
sdk: '>=2.18.0 <3.0.0'
dependencies:
ngdart: ^7.1.1
ngforms: ^4.1.1
ngrouter: ^3.1.1
http: any
js: any
pdf: ^3.9.0
barcode: ^2.2.3
ngsecurity:
git:
ref: main
url: https://github.com/angulardart-community/ngsecurity.git
dev_dependencies:
sass_builder: ^2.1.2
build_runner: any
build_test: any
build_web_compilers: any
pedantic: any
test: any
@stereotype441 |
@insinfo are you on |
webdev serve
:Dart SDK version: 2.19.0 (stable) (Mon Jan 23 11:29:09 2023 -0800) on "macos_x64"
The text was updated successfully, but these errors were encountered: