File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ func (s *Stable) WIT(ctx Node, _ string) string {
175
175
case * World :
176
176
w = ctx
177
177
}
178
- if w != nil && w . Package . Name . Version != nil {
178
+ if w != nil {
179
179
pv := w .Package .Name .Version
180
- if pv .LessThan (s .Since ) {
180
+ if pv == nil || pv .LessThan (s .Since ) {
181
181
return ""
182
182
}
183
183
}
@@ -333,6 +333,18 @@ func (ref *InterfaceRef) WIT(ctx Node, name string) string {
333
333
if ref .Stability == nil {
334
334
return ref .Interface .WIT (ctx , name )
335
335
}
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
+ }
336
348
return newline (ref .Stability .WIT (ctx , "" )) + ref .Interface .WIT (ctx , name )
337
349
}
338
350
You can’t perform that action at this time.
0 commit comments