Page MenuHomePhabricator

eolian_mono: make struct immutable
ClosedPublic

Authored by YOhoho on Jan 21 2020, 8:47 PM.

Details

Summary

Immutable value type is recommeneded for struct type in cs world.
DO NOT define mutable value types.
(see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/struct)

Also, this patch include refactoring of generated struct types.

  1. Change field type to property type that have only getter. it will fix CA1051(ref T8397).
  2. Remove internal NativeStruct. there is private field for marshalling struct instead.
  3. Fix some test cases that change value inside struct. because struct is immutable.
Test Plan

meson build -Dbindings=mono,cxx -Dmono-beta=true

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
YOhoho created this revision.Jan 21 2020, 8:47 PM
YOhoho requested review of this revision.Jan 21 2020, 8:47 PM
YOhoho updated this revision to Diff 28358.Jan 21 2020, 11:04 PM

Use camelCasing in parameter names.

woohyun accepted this revision.Jan 27 2020, 9:46 PM

This looks ok. :) Thanks you.

This revision is now accepted and ready to land.Jan 27 2020, 9:46 PM
Closed by commit rEFL581bec959894: eolian_mono: make struct immutable (authored by Yeongjong Lee <yj34.lee@samsung.com>, committed by woohyun). · Explain WhyJan 27 2020, 9:51 PM
This revision was automatically updated to reflect the committed changes.