Skip to content

built-in function print() cannot be defer'ed #219

Closed
@gopherbot

Description

@gopherbot

by echochamber:

What steps will reproduce the problem?

% cat defertest.go
package main

func main() {
    defer print("foo\n");
    print("bar\n");
}
% 8g defertest.go
defertest.go:4: fatal error: cgen_proc: unknown call EMPTY
%

What is the expected output? What do you see instead?

File defertest.8 should be created, with no console output.
Instead, it doesn't compile, as shown above.

What is your $GOOS?  $GOARCH?

linux/386

Which revision are you sync'ed to?  (hg log -l 1)

r4067

Please provide any additional information below.

Perhaps the 'bootstrapping' functions such as print() cannot
be defer'ed, but it isn't on the doc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions