Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 958 Bytes

StructuralType.md

File metadata and controls

21 lines (13 loc) · 958 Bytes

Pattern: Use of structural type

Issue: -

Description

Structural types are implemented with reflection at runtime, and are inherently less performant than nominal types. Your should prefer the use of nominal types, unless structural types provide a clear benefit.

Warning: This rule can also wrongly pick up type lamdbas and other such constructs. This rule should be used with care. You always have the alternative of the scalac checking for structural types.

Example configuration

<check enabled="true" class="org.scalastyle.scalariform.StructuralTypeChecker" level="warning"/>