code: func (m *ReferenceMap) vertexReferenceablePath(v dag.Vertex) addrs.ModuleInstance {
  	sp, ok := v.(GraphNodeSubPath)
  	if !ok {
  		// Only nodes with paths can participate in a reference map.
  		panic(fmt.Errorf("vertexMapKey on vertex type %T which doesn't implement GraphNodeSubPath", sp))
  	}
  
  	if outside, ok := v.(GraphNodeReferenceOutside); ok {
  		// Vertex is referenced from a different module than where it was
  		// declared.
  		path, _ := outside.ReferenceOutside()
  		return path
  	}
  
  	// Vertex is referenced from the same module as where it was declared.
  	return sp.Path()
  }
docs: // vertexReferenceablePath returns the path in which the given vertex can be
  // referenced. This is the path that its results from ReferenceableAddrs
  // are considered to be relative to.
  //
  // Only GraphNodeSubPath implementations can be referenced, so this method will
  // panic if the given vertex does not implement that interface.