Skip to content

Commit ac899bf

Browse files
Address review comments
1 parent 16b4100 commit ac899bf

15 files changed

+256
-151
lines changed

compiler-core/generated/schema_capnp.rs

+69-69
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler-core/schema.capnp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct Version {
5353
struct TypesVariantConstructors {
5454
variants @0 :List(TypeValueConstructor);
5555
typeParametersIds @1 :List(UInt16);
56+
opaque @2 :Bool;
5657
}
5758

5859
struct TypeValueConstructor {
@@ -77,7 +78,6 @@ struct TypeConstructor {
7778
deprecated @4 :Text;
7879
origin @5 :SrcSpan;
7980
documentation @6 :Text;
80-
opaque @7 :Bool;
8181
}
8282

8383
struct AccessorsMap {

compiler-core/src/analyse.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ use crate::{
2727
fields::{FieldMap, FieldMapBuilder},
2828
hydrator::Hydrator,
2929
prelude::*,
30-
AccessorsMap, Deprecation, ModuleInterface, PatternConstructor, RecordAccessor, Type,
31-
TypeAliasConstructor, TypeConstructor, TypeValueConstructor, TypeValueConstructorField,
32-
TypeVariantConstructors, ValueConstructor, ValueConstructorVariant, Warning,
30+
AccessorsMap, Deprecation, ModuleInterface, Opaque, PatternConstructor, RecordAccessor,
31+
Type, TypeAliasConstructor, TypeConstructor, TypeValueConstructor,
32+
TypeValueConstructorField, TypeVariantConstructors, ValueConstructor,
33+
ValueConstructorVariant, Warning,
3334
},
3435
uid::UniqueIdGenerator,
3536
warning::TypeWarningEmitter,
@@ -1108,10 +1109,15 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
11081109
);
11091110
}
11101111

1112+
let opaque = if *opaque {
1113+
Opaque::Opaque
1114+
} else {
1115+
Opaque::NotOpaque
1116+
};
11111117
// Now record the constructors for the type.
11121118
environment.insert_type_to_constructors(
11131119
name.clone(),
1114-
TypeVariantConstructors::new(constructors_data, type_parameters, hydrator),
1120+
TypeVariantConstructors::new(constructors_data, type_parameters, opaque, hydrator),
11151121
);
11161122

11171123
Ok(())
@@ -1185,7 +1191,6 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
11851191
publicity,
11861192
type_,
11871193
documentation: documentation.as_ref().map(|(_, doc)| doc.clone()),
1188-
opaque: *opaque,
11891194
},
11901195
)
11911196
.expect("name uniqueness checked above");
@@ -1260,7 +1265,6 @@ impl<'a, A> ModuleAnalyzer<'a, A> {
12601265
deprecation: deprecation.clone(),
12611266
publicity: *publicity,
12621267
documentation: documentation.as_ref().map(|(_, doc)| doc.clone()),
1263-
opaque: false,
12641268
},
12651269
)?;
12661270

compiler-core/src/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ fn mode_includes_tests() {
215215
pub struct Package {
216216
pub config: PackageConfig,
217217
pub modules: Vec<Module>,
218-
pub module_names: Vec<EcoString>,
218+
pub cached_module_names: Vec<EcoString>,
219219
}
220220

221221
impl Package {

0 commit comments

Comments
 (0)