Skip to content

get! on EnvDict does not convert Int to String anymore on 1.10.0-alpha1 #50472

Closed
@jaakkor2

Description

@jaakkor2

On Julia 1.9.2 both of these work

get!(ENV, "foo", 0)
ENV["bar"] = 1

but on Julia 1.10.0-alpha1 I get

julia> get!(ENV, "foo", 0)
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String

Closest candidates are:
  convert(::Type{String}, ::Base.JuliaSyntax.Kind)
   @ Base C:\workdir\base\JuliaSyntax\src\kinds.jl:974
  convert(::Type{String}, ::String)
   @ Base essentials.jl:321
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:84
  ...

Stacktrace:
 [1] get!(default::Base.var"#233#234"{Int64}, t::Base.EnvDict, key::String)
   @ Base .\abstractdict.jl:558
 [2] get!(t::Base.EnvDict, key::String, default::Int64)
   @ Base .\abstractdict.jl:552
 [3] top-level scope
   @ REPL[1]:1

Background: on https://pkgdocs.julialang.org/v1/environments/#Automatic-Precompilation documentation suggests that one can set environment variable to an integer ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions