<p dir="auto">I was running Julia 1.6.1, and typed <code class="notranslate">gc</code> into the REPL. This led to the errors shown below.</p>
<p dir="auto">I also have the current master branch of Julia installed (which identifies as <code class="notranslate">Julia 1.8</code>).</p>
<p dir="auto">Note that the first error mentions the file name <code class="notranslate">/Users/eschnett/.julia/environments/v1.8/Manifest.toml</code>, which is the manifest for Julia 1.8.</p>
<p dir="auto">I think each version of Julia should either be able to read other versions' manifests, or should handle such incompatibilities gracefully.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(@v1.6) pkg&gt; gc
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Warning: Reading manifest file at /Users/eschnett/.julia/environments/v1.8/Manifest.toml failed with error
│   exception =
│    MethodError: no method matching get(::Pair{String, Any}, ::String, ::Nothing)
│    Closest candidates are:
│      get(::DataStructures.Accumulator, ::Any, ::Any) at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/accumulator.jl:47
│      get(::Test.GenericDict, ::Any, ::Any) at /Users/eschnett/src/julia-1.6/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1663
│      get(::DataStructures.RobinDict{K, V}, ::Any, ::Any) where {K, V} at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/robin_dict.jl:384
│      ...
└ @ Pkg.API ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:504
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Warning: Reading manifest file at /Users/eschnett/.julia/environments/v1.7/Manifest.toml failed with error
│   exception =
│    MethodError: no method matching get(::Pair{String, Any}, ::String, ::Nothing)
│    Closest candidates are:
│      get(::DataStructures.Accumulator, ::Any, ::Any) at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/accumulator.jl:47
│      get(::Test.GenericDict, ::Any, ::Any) at /Users/eschnett/src/julia-1.6/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1663
│      get(::DataStructures.RobinDict{K, V}, ::Any, ::Any) where {K, V} at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/robin_dict.jl:384
│      ...
└ @ Pkg.API ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:504
      Active manifest files: 54 found
      Active artifact files: 208 found
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
      Active scratchspaces: 18 found
     Deleted 1 artifact installation (4.654 MiB)"><pre class="notranslate"><code class="notranslate">(@v1.6) pkg&gt; gc
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Warning: Reading manifest file at /Users/eschnett/.julia/environments/v1.8/Manifest.toml failed with error
│   exception =
│    MethodError: no method matching get(::Pair{String, Any}, ::String, ::Nothing)
│    Closest candidates are:
│      get(::DataStructures.Accumulator, ::Any, ::Any) at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/accumulator.jl:47
│      get(::Test.GenericDict, ::Any, ::Any) at /Users/eschnett/src/julia-1.6/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1663
│      get(::DataStructures.RobinDict{K, V}, ::Any, ::Any) where {K, V} at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/robin_dict.jl:384
│      ...
└ @ Pkg.API ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:504
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Warning: Reading manifest file at /Users/eschnett/.julia/environments/v1.7/Manifest.toml failed with error
│   exception =
│    MethodError: no method matching get(::Pair{String, Any}, ::String, ::Nothing)
│    Closest candidates are:
│      get(::DataStructures.Accumulator, ::Any, ::Any) at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/accumulator.jl:47
│      get(::Test.GenericDict, ::Any, ::Any) at /Users/eschnett/src/julia-1.6/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1663
│      get(::DataStructures.RobinDict{K, V}, ::Any, ::Any) where {K, V} at /Users/eschnett/.julia/packages/DataStructures/ixwFs/src/robin_dict.jl:384
│      ...
└ @ Pkg.API ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:504
      Active manifest files: 54 found
      Active artifact files: 208 found
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types ~/src/julia-1.6/usr/share/julia/stdlib/v1.6/Pkg/src/manifest.jl:150
      Active scratchspaces: 18 found
     Deleted 1 artifact installation (4.654 MiB)
</code></pre></div>
<p dir="auto">This looks valid syntax but is not accepted.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; is_array(::T) :: Bool where {T&lt;:AbstractArray} = true
ERROR: UndefVarError: T not defined
Stacktrace:
 [1] top-level scope at none:0"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">is_array</span>(<span class="pl-k">::</span><span class="pl-c1">T</span>) <span class="pl-k">::</span> <span class="pl-c1">Bool</span> <span class="pl-k">where</span> {T<span class="pl-k">&lt;:</span><span class="pl-c1">AbstractArray</span>} <span class="pl-k">=</span> <span class="pl-c1">true</span>
ERROR<span class="pl-k">:</span> UndefVarError<span class="pl-k">:</span> T not defined
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span></pre></div>
<p dir="auto">Using the same syntax, but with <code class="notranslate">function</code> keyword is accepted.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; function is_array(::T) :: Bool where {T&lt;:AbstractArray}
           return true
       end
is_array (generic function with 1 method)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">function</span> <span class="pl-en">is_array</span>(<span class="pl-k">::</span><span class="pl-c1">T</span>) <span class="pl-k">::</span> <span class="pl-c1">Bool</span> <span class="pl-k">where</span> {T<span class="pl-k">&lt;:</span><span class="pl-c1">AbstractArray</span>}
           <span class="pl-k">return</span> <span class="pl-c1">true</span>
       <span class="pl-k">end</span>
is_array (generic <span class="pl-k">function</span> with <span class="pl-c1">1</span> method)</pre></div>
<p dir="auto">Removing the return type is also accepted.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; is_array_(::T) where {T&lt;:AbstractArray} = true
is_array_ (generic function with 1 method)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-en">is_array_</span>(<span class="pl-k">::</span><span class="pl-c1">T</span>) <span class="pl-k">where</span> {T<span class="pl-k">&lt;:</span><span class="pl-c1">AbstractArray</span>} <span class="pl-k">=</span> <span class="pl-c1">true</span>
is_array_ (generic <span class="pl-k">function</span> with <span class="pl-c1">1</span> method)</pre></div>
<p dir="auto">Somewhat related issues: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="421881231" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/31378" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/31378/hovercard" href="https://github.com/JuliaLang/julia/issues/31378">#31378</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="427175548" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/31542" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/31542/hovercard" href="https://github.com/JuliaLang/julia/issues/31542">#31542</a></p>