Check missing packageid declaration
@@ -139,6 +139,7 @@ var phases = [...]struct {
check func(*Checker, *a.Node) error
}{
{a.KPackageID, (*Checker).checkPackageID},
+ {a.KInvalid, (*Checker).checkPackageIDExists},
{a.KUse, (*Checker).checkUse},
{a.KStatus, (*Checker).checkStatus},
{a.KConst, (*Checker).checkConst},
@@ -212,6 +213,13 @@ func (c *Checker) checkPackageID(node *a.Node) error {
return nil
}
+func (c *Checker) checkPackageIDExists(node *a.Node) error {
+ if c.otherPackageID == nil {
+ return fmt.Errorf("check: missing packageid declaration")
+ }
+ return nil
+}
+
func (c *Checker) checkUse(node *a.Node) error {
// TODO.
return nil
