code: func vertexReferencePath(referrer dag.Vertex) addrs.ModuleInstance {
  	sp, ok := referrer.(GraphNodeSubPath)
  	if !ok {
  		// Only nodes with paths can participate in a reference map.
  		panic(fmt.Errorf("vertexReferencePath on vertex type %T which doesn't implement GraphNodeSubPath", sp))
  	}
  
  	var path addrs.ModuleInstance
  	if outside, ok := referrer.(GraphNodeReferenceOutside); ok {
  		// Vertex makes references to objects in a different module than where
  		// it was declared.
  		_, path = outside.ReferenceOutside()
  		return path
  	}
  
  	// Vertex makes references to objects in the same module as where it
  	// was declared.
  	return sp.Path()
  }
docs: // vertexReferencePath returns the path in which references _from_ the given
  // vertex must be interpreted.
  //
  // Only GraphNodeSubPath implementations can have references, so this method
  // will panic if the given vertex does not implement that interface.