Skip to content

cmd/compile: bug in string comparison #24817

@dsymonds

Description

@dsymonds

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.10.1 (playground). This also reproduces with go version devel +b1335037fa Wed Mar 7 22:03:43 2018 +0000 linux/amd64.

Does this issue reproduce with the latest release?

It does in the playground.

What did you do?

https://play.golang.org/p/qJc3MD8uB9j

package main

import (
	"fmt"
)

func main() {
	s := "123"
	const t = "123"
	fmt.Println("" < s)
	fmt.Println("" < t)
}

What did you expect to see?

The two string comparisons should be the same, yielding true and true.

What did you see instead?

false
true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions