Open matanlurey opened 1 month ago
This should just e a compile-time error. The as
clause goes after the if
clauses.
If you write it as
import 'impl.dart' if (dart.library.io) 'impl_io.dart' as impl;
it should do what you intend.
Grammatically the 'impl.dart' if (dart.library.io) 'impl_io.dart'
is a single production <configurableUri>
which is either a URI or a URI followed by one or more conditional URIs.
Filing as parser bug, it shouldn't be allowed to parse with an if ...
after the prefix.
Hey, I'm new to contributing to dart. Can you just help with reproducing this error to me ? As per my knowledge @lrhn is right, and this is just an issue that should be solved by the following code written.
I was surprised to see that if I do the following:
I expected this to, in environments where
dart:io
is available, call therun
function inimpl_io.dart
.However, it appears that it unconditionally calls
impl.dart
due to the prefix, and it's not valid to add the same prefix: