Skip to content

Odd mistype causes Julia to hang indefinitely on simple function definition #20267

@colintbowers

Description

@colintbowers

Running Julia v0.5 (or v0.6) on Ubuntu 16.04, if one implements the following simple module:

module TestModule1
import Base:    in
export  TestType1
type TestType1{T}
    inds::Vector{T}
end
Base.in{T}(x::TestType1{T}, y::T) = in(i, x.inds)
end

And then runs the following two lines:

using TestModule1
f() = "argh"

Julia hangs indefinitely on the second line. The hang does not occur if one fixes the mistype in the line extending Base.in (that is, change the i to y). See this this thread on Discourse for full detail.

As per the linked thread, the issue has been verified on several machines running the latest v0.6, and @yuyichao has determined the issue is caused by an infinite loop or recursion in subtype.c

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions