Skip to content

Commit

Permalink
Use const instead of static readonly for constants
Browse files Browse the repository at this point in the history
This allows them to be used in switch cases and other places.
  • Loading branch information
hoffmann-stefan committed Jan 26, 2022
1 parent 4f0ecdf commit b2521a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rosidl_generator_dotnet/resource/msg.cs.em
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public class @(type_name) : global::ROS2.IRosMessage {
}

@[for constant in message.constants]@
public static readonly @(get_dotnet_type(constant.type)) @(constant.name) =
public const @(get_dotnet_type(constant.type)) @(constant.name) =
@(constant_value_to_dotnet(constant.type, constant.value));
@[end for]@

Expand Down

0 comments on commit b2521a0

Please sign in to comment.