{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/30143","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/30143/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/30143/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/30143/events","html_url":"https://github.com/dart-lang/sdk/issues/30143","id":242223064,"number":30143,"title":"Dart front-end should pick the correct import when it encounters a conditional import","user":{"login":"sivachandra","id":635361,"avatar_url":"https://avatars2.githubusercontent.com/u/635361?v=3","gravatar_id":"","url":"https://api.github.com/users/sivachandra","html_url":"https://github.com/sivachandra","followers_url":"https://api.github.com/users/sivachandra/followers","following_url":"https://api.github.com/users/sivachandra/following{/other_user}","gists_url":"https://api.github.com/users/sivachandra/gists{/gist_id}","starred_url":"https://api.github.com/users/sivachandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivachandra/subscriptions","organizations_url":"https://api.github.com/users/sivachandra/orgs","repos_url":"https://api.github.com/users/sivachandra/repos","events_url":"https://api.github.com/users/sivachandra/events{/privacy}","received_events_url":"https://api.github.com/users/sivachandra/received_events","type":"User","site_admin":false},"labels":[{"id":520924985,"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-fasta","name":"area-fasta","color":"c7def8","default":false},{"id":524536392,"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-front-end","name":"area-front-end","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-12T00:32:58Z","updated_at":"2017-07-12T00:35:33Z","closed_at":null,"body":"When I compile using the `fasta` tool, I see that only the default import of a conditional import is picked up. A simple way to see this is to compile the following code with `fasta`:\r\n\r\n```\r\nimport 'package:resource/resource.dart';\r\n\r\nvoid main() {\r\n  Resource r;\r\n}\r\n```\r\n\r\nThe package `resource` uses conditional imports in one of its source files. However, IR dump of the generated `.dill` file shows that the default import was picked up instead of the correct conditional import.\r\n\r\nThe [conditional import proposal](https://github.com/munificent/dep-interface-libraries/blob/master/Proposal.md) says that the conditions are tested using _environment declarations_. So, the `fasta` tool and the front-end API should probably be extended to take optional _environment declarations_.\r\n\r\n`dartanalyzer` supports specifying environment variables via the `-D` command line option but I am not sure if these are like the above _environment declarations_.\r\n\r\n@sigmundch @peter-ahe-google "},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/314610593","html_url":"https://github.com/dart-lang/sdk/issues/30143#issuecomment-314610593","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/30143","id":314610593,"user":{"login":"matanlurey","id":168174,"avatar_url":"https://avatars1.githubusercontent.com/u/168174?v=3","gravatar_id":"","url":"https://api.github.com/users/matanlurey","html_url":"https://github.com/matanlurey","followers_url":"https://api.github.com/users/matanlurey/followers","following_url":"https://api.github.com/users/matanlurey/following{/other_user}","gists_url":"https://api.github.com/users/matanlurey/gists{/gist_id}","starred_url":"https://api.github.com/users/matanlurey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matanlurey/subscriptions","organizations_url":"https://api.github.com/users/matanlurey/orgs","repos_url":"https://api.github.com/users/matanlurey/repos","events_url":"https://api.github.com/users/matanlurey/events{/privacy}","received_events_url":"https://api.github.com/users/matanlurey/received_events","type":"User","site_admin":false},"created_at":"2017-07-12T00:35:33Z","updated_at":"2017-07-12T00:35:33Z","body":"This is an area I'd like to kept in the loop how implementation will work.\r\n\r\n(Especially regarding bazel, where we pre-build ahead of time per package)"}}
{"actor":{"display_login":"matanlurey"}}