/*
 * Copyright 2017 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.j2cl.transpiler.integration.selfreferencingnativetype;

import jsinterop.annotations.JsType;

@JsType(namespace = "zoo")
public class Foo {
  public static String getMe() {
    return "me";
  }

  @JsType(isNative = true, name = "Foo", namespace = "zoo")
  public static class ZooFoo {
    public static native String getMe();
  }

  public static String getMeViaNative() {
    return ZooFoo.getMe();
  }
}

@@ -803,16 +803,128 @@
 %22;%0A  %7D%0A%0A
+  // Refer to the implementation %22zoo.Foo$impl%22 instead to avoid creating an %22invalid%22 circular%0A  // reference.%0A
   @JsTyp
@@ -953,16 +953,21 @@
 e = %22Foo
+$impl
 %22, names

Fix native reference so that it does not violate circularity rules between $impl and header files.