summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2004-12-13 15:00:53 +0000
committermihaylov <mihaylov@epfl.ch>2004-12-13 15:00:53 +0000
commit99847828c7cfe7da54722c0f8dcc52edc641419e (patch)
tree8d8c6f9c57320cfbaebe701093566597818034b6 /sources/scalac/symtab
parent8332a1e9d802472fe763cce3a3bf6967e74a0249 (diff)
downloadscala-99847828c7cfe7da54722c0f8dcc52edc641419e.tar.gz
scala-99847828c7cfe7da54722c0f8dcc52edc641419e.tar.bz2
scala-99847828c7cfe7da54722c0f8dcc52edc641419e.zip
[MSIL] Prevent the loading of synthetic Scala c...
[MSIL] Prevent the loading of synthetic Scala classes by marking them with a special attribute.
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r--sources/scalac/symtab/classfile/CLRPackageParser.java4
-rw-r--r--sources/scalac/symtab/classfile/CLRTypes.java13
2 files changed, 13 insertions, 4 deletions
diff --git a/sources/scalac/symtab/classfile/CLRPackageParser.java b/sources/scalac/symtab/classfile/CLRPackageParser.java
index 6375bb17a4..d97ab203a9 100644
--- a/sources/scalac/symtab/classfile/CLRPackageParser.java
+++ b/sources/scalac/symtab/classfile/CLRPackageParser.java
@@ -115,7 +115,9 @@ public final class CLRPackageParser extends PackageParser {
(clrTypes.SCALA_SYMTAB_ATTR, false);
assert attrs.length == 1 : attrs.length;
Attribute a = (Attribute)attrs[0];
- assert a.GetType() == clrTypes.SCALA_SYMTAB_ATTR : a.toString();
+ assert a.GetType() == clrTypes.SCALA_SYMTAB_ATTR : a.toString();
+ if (a.getConstructor() == clrTypes.SYMTAB_DEFAULT_CONSTR)
+ continue;
byte[] symtab = (byte[])a.getConstructorArguments()[0];
symfile = new ByteArrayFile
(type.FullName, "[" + type.Assembly().GetName() + "]",
diff --git a/sources/scalac/symtab/classfile/CLRTypes.java b/sources/scalac/symtab/classfile/CLRTypes.java
index 945261ab47..c510323492 100644
--- a/sources/scalac/symtab/classfile/CLRTypes.java
+++ b/sources/scalac/symtab/classfile/CLRTypes.java
@@ -70,10 +70,12 @@ public final class CLRTypes {
public final Type STRING;
public final Type STRING_ARRAY;
- public final Type SCALA_SYMTAB_ATTR;
-
public final Type PICO_META_ATTR;
+ public final Type SCALA_SYMTAB_ATTR;
+ public final ConstructorInfo SYMTAB_CONSTR;
+ public final ConstructorInfo SYMTAB_DEFAULT_CONSTR;
+
private final SymbolNameWriter snw = new SymbolNameWriter();
private Type[] types;
@@ -110,10 +112,15 @@ public final class CLRTypes {
STRING = getType("System.String");
STRING_ARRAY = getType("System.String[]");
- SCALA_SYMTAB_ATTR = Type.GetType("scala.runtime.SymtabAttribute");
PICO_META_ATTR = Type.GetType("scala.runtime.MetaAttribute");
+ SCALA_SYMTAB_ATTR = Type.GetType("scala.runtime.SymtabAttribute");
+ final Type[] bytearray = new Type[]{ Type.GetType("System.Byte[]") };
+ SYMTAB_CONSTR = SCALA_SYMTAB_ATTR.GetConstructor(bytearray);
+ SYMTAB_DEFAULT_CONSTR =
+ SCALA_SYMTAB_ATTR.GetConstructor(Type.EmptyTypes);
assert PICO_META_ATTR != null;
+ assert SCALA_SYMTAB_ATTR != null;
Type[] types = Type.EmptyTypes;
Iterator as = assemblies.iterator();