Skip to content

Interpreter can't upcast_distinct from UInt8* to Void* #16649

@ysbaddaden

Description

@ysbaddaden

The interpreter fails to autocast a Pointer(UInt8) to Pointer(Void) while the compiler has no issues with it:

For example:

lib Foo
  struct S
    data : Pointer(Void)
  end
end

s = Foo::S.new
s.data = Pointer(UInt8).null

p s
# => Foo::S(@data=Pointer(Void).null)
 8 | s.data = Pointer(UInt8*).null
                              ^---
Error: BUG: missing upcast_distinct from Pointer(UInt8) to Pointer(Void)
(Crystal::PointerInstanceType to Crystal::PointerInstanceType)

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions