-
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.
Browse files
Browse the repository at this point in the history
close #16610 Before this commit, the compiler ignored Scaladoc comment on multiple enum cases without warning. This is partly expected because the case to which the doc is attached is ambiguous, but we should at least warn users that the comment is ignored by compiler due to ambiguity and they should take an action if they want the doc to be displayed. [Cherry-picked 11a6f0a][modified]
- Loading branch information
1 parent
3f42535
commit 9812065
Showing
4 changed files
with
30 additions
and
1 deletion.
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
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,5 @@ | ||
-- Warning: tests/warn/i16610.scala:12:2 ------------------------------------------------------------------------------- | ||
12 | /** // warn | ||
| ^ | ||
| Ambiguous Scaladoc comment on multiple cases is ignored. | ||
| Remove the comment or make separate cases to add Scaladoc comments to each of them. |
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,16 @@ | ||
//> using options -Wenum-comment-discard | ||
/** | ||
* Description of enum | ||
*/ | ||
enum MyEnum { | ||
|
||
/** | ||
* Description of case 1 | ||
*/ | ||
case MyCase1 | ||
|
||
/** // warn | ||
* Description of case 2 and 3 | ||
*/ | ||
case MyCase2, MyCase3 | ||
} |