-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This is a weird bug:
switch (a) {
case 1:
return new ReturnValue(2012, f.fetch);
default:
return new ReturnValue(2012, f.fetch);
}
The statement inside of case 1 works however the same statement inside of the default generates the warning
() -> String is not assignable to String
Here's a small sample, note: If BaseValue doesn't exist and Return value contains both int n and String s everything works find.
class Foobar {
String value;
Foobar() {
value = "testit";
}
String get fetch() => value;
}
class BaseValue {
String s;
BaseValue(this.s);
}
class ReturnValue extends BaseValue {
int n;
ReturnValue(this.n, String s) : super(s);
}
class test {
testit(int a) {
Foobar f = new Foobar();
switch (a) {
case 1:
return new ReturnValue(2012, f.fetch);
default:
return new ReturnValue(2012, f.fetch);
}
}
}