@@ -35,21 +35,18 @@ public final class StaticModuleScope
35
35
private final TypeScopeReference associatedType ;
36
36
private final List <StaticImportExportScope > imports ;
37
37
private final List <StaticImportExportScope > exports ;
38
- private final Map <String , AtomType > typesDefinedHere ;
39
38
private final Map <TypeScopeReference , Map <String , TypeRepresentation >> methods ;
40
39
41
40
private StaticModuleScope (
42
41
QualifiedName moduleName ,
43
42
TypeScopeReference associatedType ,
44
43
List <StaticImportExportScope > imports ,
45
44
List <StaticImportExportScope > exports ,
46
- Map <String , AtomType > typesDefinedHere ,
47
45
Map <TypeScopeReference , Map <String , TypeRepresentation >> methods ) {
48
46
this .moduleName = moduleName ;
49
47
this .associatedType = associatedType ;
50
48
this .imports = imports ;
51
49
this .exports = exports ;
52
- this .typesDefinedHere = typesDefinedHere ;
53
50
this .methods = methods ;
54
51
}
55
52
@@ -60,7 +57,6 @@ static final class Builder
60
57
private final TypeScopeReference associatedType ;
61
58
private final List <StaticImportExportScope > imports = new ArrayList <>();
62
59
private final List <StaticImportExportScope > exports = new ArrayList <>();
63
- private final Map <String , AtomType > typesDefinedHere = new HashMap <>();
64
60
private final Map <TypeScopeReference , Map <String , TypeRepresentation >> methods =
65
61
new HashMap <>();
66
62
@@ -85,7 +81,6 @@ public StaticModuleScope build() {
85
81
associatedType ,
86
82
Collections .unmodifiableList (imports ),
87
83
Collections .unmodifiableList (exports ),
88
- Collections .unmodifiableMap (typesDefinedHere ),
89
84
Collections .unmodifiableMap (methods ));
90
85
}
91
86
@@ -98,14 +93,6 @@ public TypeScopeReference getAssociatedType() {
98
93
return associatedType ;
99
94
}
100
95
101
- void registerType (AtomType type ) {
102
- checkSealed ();
103
- var previous = typesDefinedHere .putIfAbsent (type .getName (), type );
104
- if (previous != null ) {
105
- throw new IllegalStateException ("Type already defined: " + type .getName ());
106
- }
107
- }
108
-
109
96
void registerMethod (TypeScopeReference parentType , String name , TypeRepresentation type ) {
110
97
checkSealed ();
111
98
var typeMethods = methods .computeIfAbsent (parentType , k -> new HashMap <>());
0 commit comments