< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java

Print this page
@@ -35,10 +35,11 @@
  import com.sun.tools.javac.code.Kinds.KindName;
  import com.sun.tools.javac.code.Kinds.KindSelector;
  import com.sun.tools.javac.code.Scope.*;
  import com.sun.tools.javac.code.Symbol.*;
  import com.sun.tools.javac.code.Type.*;
+ import com.sun.tools.javac.code.Type.ClassType.Flavor;
  import com.sun.tools.javac.main.Option.PkgInfo;
  import com.sun.tools.javac.resources.CompilerProperties.Errors;
  import com.sun.tools.javac.resources.CompilerProperties.Warnings;
  import com.sun.tools.javac.tree.*;
  import com.sun.tools.javac.tree.JCTree.*;

@@ -498,10 +499,12 @@
          c.sourcefile = env.toplevel.sourcefile;
          c.members_field = WriteableScope.create(c);
          c.clearAnnotationMetadata();
  
          ClassType ct = (ClassType)c.type;
+         ct.flavor = ct.flavor.metamorphose(c.flags_field);
+ 
          if (owner.kind != PCK && (c.flags_field & STATIC) == 0) {
              // We are seeing a local or inner class.
              // Set outer_field of this class to closest enclosing class
              // which contains this class in a non-static context
              // (its "enclosing instance class"), provided such a class exists.

@@ -516,10 +519,16 @@
          }
  
          // Enter type parameters.
          ct.typarams_field = classEnter(tree.typarams, localEnv);
          ct.allparams_field = null;
+         if (ct.isPrimitiveClass()) {
+             if (ct.projection != null) {
+                 ct.projection.typarams_field = ct.typarams_field;
+                 ct.projection.allparams_field = ct.allparams_field;
+             }
+         }
  
          // install further completer for this type.
          c.completer = typeEnter;
  
          // Add non-local class to uncompleted, to make sure it will be
< prev index next >