···261261 dependencies to be imported.
262262 ([Surya Rose](https://github.com/GearsDatapacks))
263263264264+- Erroneous extra fields in `gleam.toml` dependency specifications will no
265265+ longer be siltently ignored. An error is now returned highlighting the
266266+ problem instead.
267267+ ([Louis Pilfold](https://github.com/lpil))
268268+264269- Fixed a bug where renaming a constant which is referenced in another module
265270 inside a guard would generate invalid code.
266271 ([Surya Rose](https://github.com/GearsDatapacks))
+32-7
compiler-core/src/config.rs
···218218 fs: &FS,
219219 ) -> Result<PackageConfig, Error> {
220220 let toml = fs.read(path.as_ref())?;
221221- let config: PackageConfig = toml::from_str(&toml).map_err(|e| Error::FileIo {
222222- action: FileIoAction::Parse,
223223- kind: FileKind::File,
224224- path: path.as_ref().to_path_buf(),
225225- err: Some(e.to_string()),
226226- })?;
227227- Ok(config)
221221+ deserialise_config(path, toml)
228222 }
229223230224 /// Get the locked packages for the current config and a given (optional)
···320314 None => format!("v{version}"),
321315 }
322316 }
317317+}
318318+319319+fn deserialise_config<P: AsRef<Utf8Path>>(
320320+ path: P,
321321+ toml: String,
322322+) -> std::result::Result<PackageConfig, Error> {
323323+ let config: PackageConfig = toml::from_str(&toml).map_err(|e| Error::FileIo {
324324+ action: FileIoAction::Parse,
325325+ kind: FileKind::File,
326326+ path: path.as_ref().to_path_buf(),
327327+ err: Some(e.to_string()),
328328+ })?;
329329+ Ok(config)
330330+}
331331+332332+// https://github.com/gleam-lang/gleam/issues/4867
333333+#[test]
334334+fn deny_extra_deps_properties() {
335335+ let toml = r#"
336336+name = "wibble"
337337+version = "1.0.0"
338338+339339+[dependencies]
340340+aide_generator = { git = "git@github.com:crowdhailer/aide.git", ref = "f559c5bc", extra = "idk what this is" }
341341+"#;
342342+ let error = deserialise_config("gleam.toml", toml.into())
343343+ .expect_err("should fail to deserialise because of additional path");
344344+ assert_eq!(
345345+ error.to_string(),
346346+ r#"Parse "gleam.toml" failed: Some("data did not match any variant of untagged enum Requirement for key `dependencies.aide_generator` at line 6 column 18")"#
347347+ );
323348}
324349325350#[test]