-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13744 from som-snytt/issue/13019
Can mark var implementation as override
- Loading branch information
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
trait Ok1 { var i: Int } | ||
class Ok1C extends Ok1 { var i: Int = 1 } | ||
|
||
trait Ok2 { | ||
def i: Int | ||
def i_=(v: Int): Unit | ||
} | ||
class Ok2C extends Ok2 { override var i: Int = 1 } | ||
|
||
// was: variable i of type Int cannot override a mutable variable | ||
trait NotOk {var i: Int} | ||
class NotOkC extends NotOk { override var i: Int = 1 } |