Closed
Description
Marking a val declared in a trait final does not actually cause the emitted field to be final, due to the way traits are initialised. Therefore the atomicity guarantee of final does not hold. Additionally, the compiler does not permit vals defined in traits to be overridden anyway, so it appears that the final keyword accomplishes nothing at all in this case except to mislead programmers and cause subtle bugs.
Metadata
Metadata
Assignees
Labels
No labels