diff --git a/runtime/sema/check_transaction_declaration.go b/runtime/sema/check_transaction_declaration.go index 370a76d3c6..94ee72296d 100644 --- a/runtime/sema/check_transaction_declaration.go +++ b/runtime/sema/check_transaction_declaration.go @@ -103,8 +103,15 @@ func (checker *Checker) VisitTransactionDeclaration(declaration *ast.Transaction checker.checkResourceFieldsInvalidated(transactionType, members) - transactionType.Roles.Foreach(func(_ string, roleTye *TransactionRoleType) { - checker.checkResourceFieldsInvalidated(roleTye, roleTye.Members) + transactionType.Members.Foreach(func(_ string, member *Member) { + transactionRoleType, ok := member.TypeAnnotation.Type.(*TransactionRoleType) + if !ok { + return + } + checker.checkResourceFieldsInvalidated( + transactionRoleType, + transactionRoleType.Members, + ) }) return diff --git a/runtime/sema/type.go b/runtime/sema/type.go index dee2c43c46..b75951576a 100644 --- a/runtime/sema/type.go +++ b/runtime/sema/type.go @@ -28,7 +28,6 @@ import ( "github.com/onflow/cadence/fixedpoint" "github.com/onflow/cadence/runtime/ast" "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" "github.com/onflow/cadence/runtime/errors" ) @@ -5649,7 +5648,6 @@ func IsNilType(ty Type) bool { type TransactionType struct { Members *StringMemberOrderedMap - Roles *orderedmap.OrderedMap[string, *TransactionRoleType] Fields []string PrepareParameters []Parameter Parameters []Parameter