Skip to content

cmd/compile: println compiles to nothing #21808

@randall77

Description

@randall77

At tip,

package main

import "fmt"

func main() {
	fmt.Printf("A\n")
	println()
	fmt.Printf("B\n")
}

Should print

A

B

Instead prints

A
B

Looks like println is getting compiled to nothing. Or at least, nothing that prints. Looking at the assembly there is a printlock/printunlock pair, but nothing in between.
Doesn't seem to affect any release, so labeling 1.10.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions