From ce400c93dfbb52f388ad90f351ee2cacabe7eab0 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Fri, 23 Jan 2026 12:02:14 +0100 Subject: [PATCH] GetDeprecationMarks should return other value marks in value --- internal/lang/marks/marks.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/lang/marks/marks.go b/internal/lang/marks/marks.go index 6ad762b325..3d59ea63c8 100644 --- a/internal/lang/marks/marks.go +++ b/internal/lang/marks/marks.go @@ -51,21 +51,25 @@ func Contains(val cty.Value, mark interface{}) bool { // FilterDeprecationMarks returns all deprecation marks present in the given // cty.ValueMarks. -func FilterDeprecationMarks(marks cty.ValueMarks) []DeprecationMark { +func FilterDeprecationMarks(marks cty.ValueMarks) (cty.ValueMarks, []DeprecationMark) { + other := cty.ValueMarks{} depMarks := []DeprecationMark{} for mark := range marks { if d, ok := mark.(DeprecationMark); ok { depMarks = append(depMarks, d) + } else { + other[mark] = struct{}{} } } - return depMarks + return other, depMarks } // GetDeprecationMarks returns all deprecation marks present on the given // cty.Value. func GetDeprecationMarks(val cty.Value) (cty.Value, []DeprecationMark) { unmarked, marks := val.Unmark() - return unmarked, FilterDeprecationMarks(marks) + other, depMarks := FilterDeprecationMarks(marks) + return unmarked.WithMarks(other), depMarks } // RemoveDeprecationMarks returns a copy of the given cty.Value with all