Skip to content

cmd/compile/internal/ir: OCONVNOP is documented as having no effect, but it might change the type #71841

Open
@mateusz834

Description

@mateusz834

I am unsure whether this is a bug or not, but the current docs of OCONVNOP is as follows:

OCONVNOP // Type(X) (type conversion, no effect)

Note the "no effect", but actually it can change the type:

type Impl struct{}
type implWrapper Impl

func _() {
	i := &Impl{}
        _ = (*implWrapper)(i) // OCONVNOP
}

Is this the expected behavior? If so i think that the docs should be updated, as it might be confusing (as it is a NOP).

CC @golang/compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions