-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
Now that the `MemoryLayout` sealed hierarchy provides the same information, these redundant methods should be removed for reasons of consistency, symmetry, brevity and simplicity.
Here are the proposed replacements in user code:
layout.isPadding() -> layout instanceof PaddingLayout
layout.isUnion() -> layout instanceof UnionLayout
layout.isStruct() -> layout instanceof StructLayout
or in pattern matching:
switch (layout) {
case PaddingLayout padding ->
case UnionLayout union ->
case StructLayout struct ->
// more here
}
The proposed changes will affect the API which is in *preview*.
Here are the proposed replacements in user code:
layout.isPadding() -> layout instanceof PaddingLayout
layout.isUnion() -> layout instanceof UnionLayout
layout.isStruct() -> layout instanceof StructLayout
or in pattern matching:
switch (layout) {
case PaddingLayout padding ->
case UnionLayout union ->
case StructLayout struct ->
// more here
}
The proposed changes will affect the API which is in *preview*.