@@ -21,9 +21,10 @@ use crate::{
21
21
line_numbers:: LineNumbers ,
22
22
parse:: SpannedString ,
23
23
type_:: {
24
- self , AccessorsMap , Deprecation , ModuleInterface , PatternConstructor , RecordAccessor , Type ,
25
- TypeAliasConstructor , TypeConstructor , TypeValueConstructor , TypeValueConstructorField ,
26
- TypeVariantConstructors , ValueConstructor , ValueConstructorVariant , Warning ,
24
+ self , AccessorsMap , Deprecation , ModuleInterface , Opaque , PatternConstructor ,
25
+ RecordAccessor , Type , TypeAliasConstructor , TypeConstructor , TypeValueConstructor ,
26
+ TypeValueConstructorField , TypeVariantConstructors , ValueConstructor ,
27
+ ValueConstructorVariant , Warning ,
27
28
environment:: * ,
28
29
error:: { Error , FeatureKind , MissingAnnotation , Named , Problems , convert_unify_error} ,
29
30
expression:: { ExprTyper , FunctionDefinition , Implementations } ,
@@ -1108,10 +1109,15 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
1108
1109
) ;
1109
1110
}
1110
1111
1112
+ let opaque = if * opaque {
1113
+ Opaque :: Opaque
1114
+ } else {
1115
+ Opaque :: NotOpaque
1116
+ } ;
1111
1117
// Now record the constructors for the type.
1112
1118
environment. insert_type_to_constructors (
1113
1119
name. clone ( ) ,
1114
- TypeVariantConstructors :: new ( constructors_data, type_parameters, hydrator) ,
1120
+ TypeVariantConstructors :: new ( constructors_data, type_parameters, opaque , hydrator) ,
1115
1121
) ;
1116
1122
1117
1123
Ok ( ( ) )
@@ -1185,7 +1191,6 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
1185
1191
publicity,
1186
1192
type_,
1187
1193
documentation : documentation. as_ref ( ) . map ( |( _, doc) | doc. clone ( ) ) ,
1188
- opaque : * opaque,
1189
1194
} ,
1190
1195
)
1191
1196
. expect ( "name uniqueness checked above" ) ;
@@ -1260,7 +1265,6 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
1260
1265
deprecation : deprecation. clone ( ) ,
1261
1266
publicity : * publicity,
1262
1267
documentation : documentation. as_ref ( ) . map ( |( _, doc) | doc. clone ( ) ) ,
1263
- opaque : false ,
1264
1268
} ,
1265
1269
) ?;
1266
1270
0 commit comments