-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
releasedIncluded in a releaseIncluded in a releasevalidation ✔️Improved or new static checksImproved or new static checks
Milestone
Description
Basic example: If the overridden method is pure, the overriding method must be pure as well:
package tests.validation.other.declarations.functions.purePropagates
class MyOpenClass {
@Pure fun pureFunction1()
@Pure fun pureFunction2()
fun impureFunction1()
}
class MyClass sub MyOpenClass {
// $TEST$ no error "One of the supertypes of this class declares a pure function with this name, so this must be pure as well."
@Pure fun »ownPureFunction«()
// $TEST$ no error "One of the supertypes of this class declares a pure function with this name, so this must be pure as well."
fun »ownImpureFunction«()
// $TEST$ error "One of the supertypes of this class declares a pure function with this name, so this must be pure as well."
fun »pureFunction1«()
// $TEST$ no error "One of the supertypes of this class declares a pure function with this name, so this must be pure as well."
@Pure fun »pureFunction2«()
// $TEST$ no error "One of the supertypes of this class declares a pure function with this name, so this must be pure as well."
@Pure fun »impureFunction1«()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
releasedIncluded in a releaseIncluded in a releasevalidation ✔️Improved or new static checksImproved or new static checks
Type
Projects
Status
✔️ Done