src/share/classes/com/sun/tools/javac/code/Type.java

Print this page

        

@@ -788,11 +788,19 @@
 
         public MethodType(List<Type> argtypes,
                           Type restype,
                           List<Type> thrown,
                           TypeSymbol methodClass) {
-            super(METHOD, methodClass);
+            this(METHOD, argtypes, restype, thrown, methodClass);
+        }
+        
+        public MethodType(int tag,  // METHOD or FUNCTION
+                          List<Type> argtypes,
+                          Type restype,
+                          List<Type> thrown,
+                          TypeSymbol methodClass) {
+            super(tag, methodClass);
             this.argtypes = argtypes;
             this.restype = restype;
             this.thrown = thrown;
         }
 

@@ -857,11 +865,11 @@
             Type restype1 = f.apply(restype);
             List<Type> thrown1 = map(thrown, f);
             if (argtypes1 == argtypes &&
                 restype1 == restype &&
                 thrown1 == thrown) return this;
-            else return new MethodType(argtypes1, restype1, thrown1, tsym);
+            else return new MethodType(tag, argtypes1, restype1, thrown1, tsym);
         }
 
         public boolean contains(Type elem) {
             return elem == this || contains(argtypes, elem) || restype.contains(elem);
         }