public Method? current_method {
get {
unowned Symbol sym = current_symbol;
- while (sym is Block) {
+ while (sym is Block || sym is Constant) {
sym = sym.parent_symbol;
}
return sym as Method;
public Method? current_async_method {
get {
unowned Symbol sym = current_symbol;
- while (sym is Block || sym is Method) {
+ while (sym is Block || sym is Constant || sym is Method) {
var m = sym as Method;
if (m != null && m.coroutine) {
break;
public PropertyAccessor? current_property_accessor {
get {
unowned Symbol sym = current_symbol;
- while (sym is Block) {
+ while (sym is Block || sym is Constant) {
sym = sym.parent_symbol;
}
return sym as PropertyAccessor;
public Symbol? current_method_or_property_accessor {
get {
unowned Symbol sym = current_symbol;
- while (sym is Block) {
+ while (sym is Block || sym is Constant) {
sym = sym.parent_symbol;
}
if (sym is Method) {
}
public Method? find_parent_method (Symbol sym) {
- while (sym is Block) {
+ while (sym is Block || sym is Constant) {
sym = sym.parent_symbol;
}
return sym as Method;
}
public Symbol? find_parent_method_or_property_accessor (Symbol sym) {
- while (sym is Block) {
+ while (sym is Block || sym is Constant) {
sym = sym.parent_symbol;
}
if (sym is Method) {