Skip to content

No longer possible to define a function String #57290

@lgoettgens

Description

@lgoettgens

The following code snippet currently behaves differently between 1.11 and nightly:

julia> module Foo
         String(i::Int) = i
       end
Main.Foo

julia> Foo.String === String
false   # 1.11
true    # nightly

A real-world example of this is oscar-system/GAP.jl#1146 (comment). In the submodule GAP.Wrappers of GAP.jl, we create julia wrapper functions around GAP functions using a @wrap macro, and we keep the function names from GAP.
GAP has a function named String, so we create a function GAP.Wrappers.String, which worked for the last years, but no longer in nightly. There, this instead creates a new method for Core.String.

I bisected this to #57253 by @Keno.

Metadata

Metadata

Assignees

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