File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ func (s *Stable) WIT(ctx Node, _ string) string {
175175 case * World :
176176 w = ctx
177177 }
178- if w != nil && w . Package . Name . Version != nil {
178+ if w != nil {
179179 pv := w .Package .Name .Version
180- if pv .LessThan (s .Since ) {
180+ if pv == nil || pv .LessThan (s .Since ) {
181181 return ""
182182 }
183183 }
@@ -333,6 +333,18 @@ func (ref *InterfaceRef) WIT(ctx Node, name string) string {
333333 if ref .Stability == nil {
334334 return ref .Interface .WIT (ctx , name )
335335 }
336+ var w * World
337+ switch ctx := ctx .(type ) {
338+ case worldImport :
339+ w = ctx .World
340+ case worldExport :
341+ w = ctx .World
342+ case * World :
343+ w = ctx
344+ }
345+ if ref .Stability .Versioned () && w != nil && w .Package != ref .Interface .Package {
346+ return ref .Interface .WIT (ctx , name )
347+ }
336348 return newline (ref .Stability .WIT (ctx , "" )) + ref .Interface .WIT (ctx , name )
337349}
338350
You can’t perform that action at this time.
0 commit comments