-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add futures showing that
override
can be applied to init() and post…
…init() (#26518) [trivial, not reviewed] This adds some futures noting that `override` can be applied to `init()` and `postinit()`, where we should probably flag that as an error (issue #26515).
- Loading branch information
Showing
16 changed files
with
91 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({x = 45}, {x = 45, y = 33}) |
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,17 @@ | ||
class C { | ||
var x: int; | ||
proc init() { | ||
this.x = 45; | ||
} | ||
} | ||
|
||
class D: C { | ||
var y: int; | ||
override proc init() { | ||
this.y = 33; | ||
} | ||
} | ||
|
||
var myC = new C(); | ||
var myD = new D(); | ||
writeln((myC, myD)); |
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,7 @@ | ||
bug: postinit() shouldn't accept 'override' | ||
|
||
I don't believe that init() routines should accept 'override' | ||
decorations given that they aren't really dynamically dispatched or | ||
overridden in the normal way. | ||
|
||
#26515 |
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 @@ | ||
override.chpl:10: error: the 'override' keyword cannot be applied to 'init()' routines |
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,2 @@ | ||
In C.postinit() | ||
In D.postinit() |
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 @@ | ||
class C { | ||
proc postinit() { | ||
writeln("In C.postinit()"); | ||
} | ||
} | ||
|
||
class D: C { | ||
override proc postinit() { | ||
writeln("In D.postinit()"); | ||
} | ||
} | ||
|
||
var myD = new D(); |
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,7 @@ | ||
bug: postinit() shouldn't accept 'override' | ||
|
||
I don't believe that postinit() routines should accept 'override' | ||
decorations given that they aren't really dynamically dispatched or | ||
overridden in the normal way. | ||
|
||
#26515 |
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 @@ | ||
override.chpl:8: error: the 'override' keyword cannot be applied to 'postinit()' routines |
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,2 @@ | ||
In C.postinit() | ||
In D.postinit() |
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 @@ | ||
class C { | ||
proc postinit() throws { | ||
writeln("In C.postinit()"); | ||
} | ||
} | ||
|
||
class D: C { | ||
override proc postinit() { | ||
writeln("In D.postinit()"); | ||
} | ||
} | ||
|
||
var myD = new D(); |
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,7 @@ | ||
bug: postinit() shouldn't accept 'override' | ||
|
||
I don't believe that postinit() routines should accept 'override' | ||
decorations given that they aren't really dynamically dispatched or | ||
overridden in the normal way. | ||
|
||
#26515 |
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 @@ | ||
override2.chpl:8: error: the 'override' keyword cannot be applied to 'postinit()' routines |
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 @@ | ||
In D.postinit() |
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,10 @@ | ||
class C { | ||
} | ||
|
||
class D: C { | ||
override proc postinit() throws { | ||
writeln("In D.postinit()"); | ||
} | ||
} | ||
|
||
var myD = new D(); |
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,7 @@ | ||
bug: postinit() shouldn't accept 'override' | ||
|
||
I don't believe that postinit() routines should accept 'override' | ||
decorations given that they aren't really dynamically dispatched or | ||
overridden in the normal way. | ||
|
||
#26515 |
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 @@ | ||
override3.chpl:5: error: the 'override' keyword cannot be applied to 'postinit()' routines |