Skip to content

Typecasting nil results in non-nil #843

Open
@seanburke-wf

Description

@seanburke-wf

If a variable has value nil and is typecast, the result will have a non-nil value which appears to be an invalid pointer. This differs from the behavior of Go.

The following illustrate the difference in behaviors between Go and compiled gopherjs:
https://play.golang.org/p/_feur6S2EjC
https://gopherjs.github.io/playground/#/y785Hlp5q0

Additionally, the non-nil value appears to be an invalid reference:
https://play.golang.org/p/ugzWXe4x2HE
https://gopherjs.github.io/playground/#/HkVf0Bqs1m

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixNeedsHelpCommunity contributions are welcome for this feature!bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions