Closed AlisCode closed 3 years ago
Running make
results into a compilation error
error[E0308]: mismatched types
--> ts_json_subset/src/types.rs:329:28
|
329 | ArrayType::new(PrimaryType::Predefined(PredefinedType::Any)).to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected enum `types::TsType`, found enum `types::PrimaryType`
| help: try using a variant of the expected enum: `types::TsType::PrimaryType(PrimaryType::Predefined(PredefinedType::Any))`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: could not compile `ts_json_subset`
Pushed the fix for tests as well, thanks for reviewing :)
ArrayType used to allow only
PrimaryType
as its inner type, meaning it wasnt possible to represent types such as :which are in fact valid TypeScript.
ArrayType
should be either aPrimaryType
or aParenthesizedType
to allow for that representation. Changing this fixes both theArray
and theCollections
solvers, allowing for representation of Rust types such asVec<Option<T>>
.