Skip to content

Commit 0cacbca

Browse files
committed
wit: add Stability.Versioned method
1 parent 4ae64e7 commit 0cacbca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

wit/stability.go

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
type Stability interface {
99
Node
1010
isStability()
11+
Versioned() bool
1112
}
1213

1314
// _stability is an embeddable type that conforms to the [Stability] interface.
@@ -24,9 +25,19 @@ type Stable struct {
2425
Deprecated *semver.Version
2526
}
2627

28+
// Versioned always returns true for [Stable].
29+
func (*Stable) Versioned() bool {
30+
return true
31+
}
32+
2733
// Unstable represents an unstable WIT feature defined by name.
2834
type Unstable struct {
2935
_stability
3036
Feature string
3137
Deprecated *semver.Version
3238
}
39+
40+
// Versioned returns whether [Unstable] is deprecated.
41+
func (u *Unstable) Versioned() bool {
42+
return u.Deprecated != nil
43+
}

0 commit comments

Comments
 (0)