Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KT-3181 Prohibit val/var keywords for function parameters
#KT-3181
- Loading branch information
Evgeny Gerashchenko
authored and
Evgeny Gerashchenko
committed
Feb 13, 2013
1 parent
808dbd1
commit b1cb8ed
Showing
7 changed files
with
37 additions
and
10 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
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
12 changes: 12 additions & 0 deletions
12
compiler/testData/diagnostics/tests/declarationChecks/valVarFunctionParameter.kt
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,12 @@ | ||
fun f( | ||
<!VAL_OR_VAR_ON_FUN_PARAMETER!>val<!> a: Int, | ||
<!VAL_OR_VAR_ON_FUN_PARAMETER!>var<!> b: Int, | ||
c: Int, | ||
vararg <!VAL_OR_VAR_ON_FUN_PARAMETER!>var<!> d: Int, | ||
vararg <!VAL_OR_VAR_ON_FUN_PARAMETER!>val<!> e: Int, | ||
vararg f: Int | ||
) { | ||
|
||
|
||
a + b + c + d[0] + e[0] + f[0] // to avoid 'unused parameter' | ||
} |
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