Skip to content

StackOverflow from function definition #31861

@dlfivefifty

Description

@dlfivefifty

This is also present in Julia v1.1:

julia> struct ProductSpace{T<:Tuple}
       end

julia> using StaticArrays
[ Info: Precompiling StaticArrays [90137ffa-7385-5640-81b9-e52037218182]

julia> function convert_space(::Type{ProductSpace{Tuple{SVector{M,T},T}}}, x::SVector{N,T}) where {N,M,T}
       end
convert_space (generic function with 1 method)

julia> function convert_space(::Type{ProductSpace{Tuple{T,SVector{M,T}}}}, x::SVector{N,T}) where {N,M,T}
       end
ERROR: StackOverflowError:
Stacktrace:
 [1] top-level scope at REPL[4]:1

julia> versioninfo()
Julia Version 1.3.0-DEV.121
Commit dc6c7c7e6f (2019-04-27 03:49 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.5.0)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

No one assigned

    Labels

    types and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions