···5050 importable_modules: &modules,
5151 warnings: &TypeWarningEmitter::null(),
5252 direct_dependencies: &std::collections::HashMap::new(),
5353+ dev_dependencies: &std::collections::HashSet::new(),
5354 target_support: TargetSupport::Enforced,
5455 package_config: &config,
5556 }
···7677 // to have one place where we create all this required state for use in each
7778 // place.
7879 let _ = modules.insert(PRELUDE_MODULE_NAME.into(), type_::build_prelude(&ids));
8080+ let dev_dependencies = std::collections::HashSet::new();
8181+7982 let mut environment = EnvironmentArguments {
8083 ids,
8184 current_package: "thepackage".into(),
···8588 importable_modules: &modules,
8689 target_support: TargetSupport::Enforced,
8790 current_origin: Origin::Src,
9191+ dev_dependencies: &dev_dependencies,
8892 }
8993 .build();
9094
···13531353 extra_labels: vec![],
13541354 }),
13551355 },
13561356+13571357+ type_::Warning::SrcImportingDevDependency {
13581358+ location,
13591359+ importing_module,
13601360+ imported_module,
13611361+ package,
13621362+ } => {
13631363+ let text = wrap(&format!(
13641364+ "The application module `{importing_module}` is \
13651365+importing the module `{imported_module}`, but `{package}`, the package it \
13661366+belongs to, is a dev dependency.
13671367+13681368+Dev dependencies are not included in production builds so application \
13691369+modules should not import them. Perhaps change `{package}` to a regular dependency.
13701370+13711371+In a future version of Gleam this may become a compile error."
13721372+ ));
13731373+ Diagnostic {
13741374+ title: "App importing dev dependency".into(),
13751375+ text,
13761376+ hint: None,
13771377+ level: diagnostic::Level::Warning,
13781378+ location: Some(Location {
13791379+ src: src.clone(),
13801380+ path: path.to_path_buf(),
13811381+ label: diagnostic::Label {
13821382+ text: None,
13831383+ span: *location,
13841384+ },
13851385+ extra_labels: Vec::new(),
13861386+ }),
13871387+ }
13881388+ }
13561389 },
1357139013581391 Warning::DeprecatedEnvironmentVariable { variable } => {
···11+// This should raise a warning as `gleam_stdlib` is a dev dependency.
22+import gleam/io
33+44+pub fn main() {
55+ io.println("Hello, world!")
66+}