-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#954 Добавление типизированного значения в не типизированную коллекцию (
- Loading branch information
Showing
13 changed files
with
447 additions
and
34 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
30 changes: 30 additions & 0 deletions
30
...com.e1c.v8codestyle.bsl/markdown/ru/typed-value-adding-to-untyped-collection.md
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,30 @@ | ||
# Добавление типизированного значения в не типизированную коллекцию | ||
|
||
Проверяет, что вызов метода ```Добавить()``` происходит для типизированной коллекции. | ||
|
||
## Неправильно | ||
|
||
Тип элементов коллекции не указан. | ||
|
||
```bsl | ||
// @strict-types | ||
Результат = Новый Массив(); | ||
Результат.Добавить(42); | ||
``` | ||
|
||
## Правильно | ||
|
||
Необходимо указать тип элементов коллекции. | ||
|
||
```bsl | ||
// @strict-types | ||
Результат = Новый Массив(); // Массив из Число | ||
Результат.Добавить(42); | ||
``` | ||
|
||
## См. | ||
|
26 changes: 26 additions & 0 deletions
26
...es/com.e1c.v8codestyle.bsl/markdown/typed-value-adding-to-untyped-collection.md
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,26 @@ | ||
# Typed value is added to untyped collection | ||
|
||
Checks that collection method ```Add()``` is calling for untyped collection | ||
|
||
## Noncompliant Code Example | ||
|
||
```bsl | ||
// @strict-types | ||
Result = New Array(); | ||
Result.Add(42); | ||
``` | ||
|
||
## Compliant Solution | ||
|
||
```bsl | ||
// @strict-types | ||
Result = New Array(); // Array of Number | ||
Result.Add(42); | ||
``` | ||
|
||
## See | ||
|
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
Oops, something went wrong.