Skip to content

import . does not cause redeclaration errors #455

@bjkail

Description

@bjkail
What steps will reproduce the problem?
1. Compile the following programs:
a.go:
package a
var X = 0

b.go:
package main
import . "a"
var X = 0


What is the expected output? What do you see instead?
Expected:
b.go:3: X redeclared in this block
        previous declaration at a.go:2

or perhaps:
b.go:2: imported and not used: a

Actual:
(no errors)


What is your $GOOS?  $GOARCH?
GOARCH=386
GOOS=linux


Which revision are you using?  (hg identify)
7929874a70ae tip


Please provide any additional information below.
The spec for import . says "all the package's exported identifiers will be
declared in the current file's file block", so the example above should
probably be diagnosed with a redeclaration error.

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