Skip to content
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

Angular code generator needs to be verified to work with optional new and const #33221

Closed
leafpetersen opened this issue May 24, 2018 · 16 comments
Assignees
Milestone

Comments

@leafpetersen
Copy link
Member

This is the angular specific issue for #30921 .

@leafpetersen
Copy link
Member Author

We don't seem to have an area-frameworks flag to triage with, should we?

cc @matanlurey

@matanlurey
Copy link
Contributor

Probably an Customer: Frameworks is probably fine, or similar.

@natebosch
Copy link
Member

@MichaelRFairhurst is currently investigating a potential breakage. We need to narrow down whether there is an edge case in the analyzer, or in angular/the build systems usage of the analyzer.

@dgrove
Copy link
Contributor

dgrove commented May 29, 2018

any updates here?

@MichaelRFairhurst
Copy link
Contributor

MichaelRFairhurst commented May 29, 2018 via email

@matanlurey
Copy link
Contributor

I saw this on the dart-lang/build gitter:

Source_gen problem...
This work as expected:

@Propagate(const ['id', 'name', 'enabled', 'sex'], const {
    'items': const Propagate(['id', 'type', 'index', 'insertType.id',
    'insertType.name', 'video.id', 'video.name'])
  })

Becomes this DartObject

Propagate (fields = List ([String ('id'), String ('name'), String ('enabled'), String ('sex')]); relationships = Map ({String ('items') = Propagate (fields = List ([String ('id'), String ('type'), String ('index'), String ('insertType.id'), String ('insertType.name'), String ('video.id'), String ('video.name')]); relationships = Null (null); when = Null (null))}); when = Null (null))

When I remove the const keyword from the relationships property

const {
    'items': ...

It becomes this DartObject:

Propagate (fields = List ([String ('id'), String ('name'), String ('enabled'), String ('sex')]); relationships = Null (null); when = Null (null))

The relatshionps property becomes null

@MichaelRFairhurst
Copy link
Contributor

I believe this is fixed with https://dart-review.googlesource.com/c/sdk/+/57000. Going to do my best to try to confirm that, with that fix, there are no remaining issues.

@dgrove
Copy link
Contributor

dgrove commented Jun 5, 2018

Any updates?

@MichaelRFairhurst
Copy link
Contributor

I do have some issues I've seen, I thought I had reproed them correctly but found out I was debugging the wrong issue. So I am still working on that.

There's also a DDC issue which may be the same, or different (inside DDC or analyzer).

@MichaelRFairhurst
Copy link
Contributor

the second analyzer issue I found was fixed: https://dart-review.googlesource.com/c/sdk/+/58800

the DDC issue is still outstanding

@leafpetersen
Copy link
Member Author

cc @munificent

@MichaelRFairhurst What's the status on this?

@MichaelRFairhurst
Copy link
Contributor

Have been working on #30384 which has dragged on more than I expected. I should have either a fix for, or repro of, the DDC issue in a few days (hopefully, some point this weekend)

@MichaelRFairhurst
Copy link
Contributor

The DDC issue here seems to be the original issue which prompted this. It merely reared its head at different times, and internally, required a patch to dart_lang in addition to third_party/ analyzer.

It seems from my tests that this is now working perfectly. Will keep straining the system a bit longer to increase my certainty in this.

@MichaelRFairhurst
Copy link
Contributor

Glad I ran further tests.

Found yet another issue related to type parameters. Haven't yet distilled the error I'm seeing, but I'm getting A value of type 'OpaqueToken<T>' can't be assigned to a variable of type 'OpaqueToken<String>' in something like the following case:

// a.dart:
const x = OpaqueToken<String>(...);

// b.dart:
import 'a.dart' as a;
const x = a.x; // assignment error here!

Which is very, very strange. Working to distill this now.

@matanlurey
Copy link
Contributor

Thanks!

@MichaelRFairhurst
Copy link
Contributor

MichaelRFairhurst commented Jun 14, 2018

OK, digging further, that was a false alarm.

I am now extremely confident that this will work -- assuming you use --preview-dart-2 of course!

Edit: s/not/now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants