I'm not sure if this is a bug in the Darts Editor or a problem with the way I use part of, but given the following project structure:
myapp/
pubspec.yaml
pubspec.lock
asset/
packages/
build/
web/
Fizz.dart
Buzz.dart
Where Fizz.dart:
library fizz;
void herp() {
print("Herp!");
}
and where Buzz.dart:
library buzz;
void derp() {
String x = "Derp!";
print(x);
}
If I change Buzz.dartto intentionally having a compiler error:
library buzz;
void derp() {
djedString x = "Derp!"; // Produces "Undefined class 'djedString'" error
print(x);
}
The Dart editor then underlines with a djedStringred line and gives the above compiler error:
Undefined class 'djedString'
But if I then change Buzz.dartas a part oflibrary fizz:
part of fizz;
void derp() {
djedString x = "Derp!"; // Perfectly fine! No errors!
print(x);
}
The Dart editor then removes the compiler error and actually stops looking for warnings / errors (inside the file).
Is this a mistake or am I using it incorrectly part of?