$continue_inner: true;
$continue_outer: true;
$root_default: initial;
$root_implicit: initial;
$root_explicit: initial !global;

@function fn() {
  @while $continue_outer {
    $root_implicit: outer;
    $root_explicit: outer !global;
    $root_default: outer !default;
    $local_implicit: outer;
    $local_explicit: outer !global;
    $local_default: outer !default;
    @while $continue_inner {
      $root_implicit: inner;
      $root_explicit: inner !global;
      $root_default: inner !default;
      $local_implicit: inner;
      $local_explicit: inner !global;
      $local_default: inner !default;
      $continue_inner: false;
    }
    $continue_outer: false;
  }
  $check_implicit: $root_implicit !global;
  $check_explicit: $root_explicit !global;
  $check_default: $root_default !global;
  @return null;
}

result {
  fn: fn();
  @if variable-exists(continue_outer) {
    continue_outer: $continue_outer;
  }
  @if variable-exists(continue_inner) {
    continue_inner: $continue_inner;
  }
  @if variable-exists(check_implicit) {
    check_implicit: $check_implicit;
  }
  @if variable-exists(check_explicit) {
    check_explicit: $check_explicit;
  }
  @if variable-exists(check_default) {
    check_default: $check_default;
  }
  root_default: $root_default;
  root_implicit: $root_implicit;
  root_explicit: $root_explicit;
  @if variable-exists(local_default) {
    local_default: $local_default;
  }
  @if variable-exists(local_implicit) {
    local_implicit: $local_implicit;
  }
  @if variable-exists(local_explicit) {
    local_explicit: $local_explicit;
  }
}
