Skip to content

Let's review pending changes #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 82 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
3752890
Pass webpack build mode through gradle parameters
petukhovv Jul 27, 2020
78516c8
Replace hardcoded mode to defined by url's get parameter one
petukhovv Jul 27, 2020
a484d2e
Turn Compatitiblity chapter into a paragraph
zarechenskiy Jul 28, 2020
c2b017c
Fix paragraph about Compatibility
zarechenskiy Jul 28, 2020
f1445ac
exclude compatibility section to load tests
stasjas Jul 28, 2020
ddf3529
Fix typo in Reload tests button label
Egorand Aug 1, 2020
2d5a7ca
Change formal argument -> formal parameter to disambiguate even more
ice-phoenix Aug 3, 2020
8875691
Add a note about PRs should be based on develop branch
ice-phoenix Aug 3, 2020
d238f9c
Bare types sketch
belyaev-mikhail Aug 6, 2020
391cc92
Some clarifications about data class generated function explicificati…
ice-phoenix Aug 7, 2020
fd4d3c3
Fix typo
ice-phoenix Aug 10, 2020
f740a26
Some rewriting on the bare type syntax
belyaev-mikhail Aug 12, 2020
f5168dc
Fix typo
ice-phoenix Aug 14, 2020
86b8a4b
Some details of how `val`/`var` properties work (#59)
ice-phoenix Aug 24, 2020
08c736a
Add TODO about funky Kotlin script file scope
ice-phoenix Aug 27, 2020
3ad1613
Add a note about only inner classes being allowed in object literals
ice-phoenix Aug 27, 2020
1733307
Fix typo
ice-phoenix Aug 27, 2020
5c5762d
Clarifications on where inner classes are and are not allowed
ice-phoenix Aug 27, 2020
4c478b2
Better wording
ice-phoenix Aug 28, 2020
79c093a
kotlin.Annotation is an interface
belyaev-mikhail Aug 31, 2020
e935d1c
Fix broken link
belyaev-mikhail Sep 1, 2020
e18cc50
Contracts draft
belyaev-mikhail Sep 1, 2020
71acc44
Inline classes draft
belyaev-mikhail Sep 1, 2020
7302377
First example for type capturing
ice-phoenix Sep 1, 2020
c5811dc
More type capturing examples
ice-phoenix Sep 2, 2020
e71b05d
Smart casts: change Direct assignments to Simple assignments
ice-phoenix Sep 4, 2020
0870b5f
Fixing Unicode problems in PDF
ice-phoenix Sep 5, 2020
d35e0c2
Fix sentence-finder-bar style in Dev mode
stasjas Sep 8, 2020
cf9a626
Improve header bar style in dev mode
stasjas Sep 8, 2020
8be83b6
Disable kotlin core section link in toc
stasjas Sep 8, 2020
14e1079
@Experimental machinery -> @OptIn machinery
belyaev-mikhail Sep 9, 2020
93ee5af
Add example with recursive types and type capturing
ice-phoenix Sep 9, 2020
8e429c5
BuilderInference sketch
belyaev-mikhail Sep 10, 2020
75bea9b
`kotlin.RestrictSuspension` + fix broken link
ice-phoenix Sep 10, 2020
9d3da3f
Undefined behaviour -> unspecified behaviour
belyaev-mikhail Sep 15, 2020
5d3b96c
Start transferring external knowledge about coroutines to the spec
ice-phoenix Sep 17, 2020
34171bb
Add TODO about GLB/LUB and flexible types and intersection with Any
ice-phoenix Sep 23, 2020
12d04d6
Introduce sectionsTestMap loading to load only existing testMaps
stasjas Sep 10, 2020
3c42b3f
Fix "Inconsistent formatting for rule alternatives" (fix #36), "Get r…
KvanTTT Aug 12, 2020
62ce460
Describe continuation interception
ice-phoenix Oct 1, 2020
cb0ae78
\eq -> =:=
ice-phoenix Oct 5, 2020
a618173
Some examples and details for enum classes
belyaev-mikhail Oct 12, 2020
b33ccef
Fix a link in the grammar README.md
martinbonnin Nov 3, 2020
ec87a64
Merge pull request #66 from martinbonnin/patch-1
ice-phoenix Nov 3, 2020
a5054d2
Add JVM-specific note on array types not allowed as upper bounds in t…
ice-phoenix Dec 9, 2020
c432195
Clarifications about default argument evaluation order for #67
ice-phoenix Jan 25, 2021
8e6244e
Further clarifications for #67
ice-phoenix Jan 25, 2021
928a9a0
Switching from SVN to git sparse-checkout for grammar tests
ice-phoenix Jan 25, 2021
ccfc472
Bump gradle-intellij-plugin version to 0.4.26
ice-phoenix Jan 25, 2021
dd4871f
Make :grammar:compileKotlin depend on :grammar:generateGrammarSource
ice-phoenix Jan 26, 2021
0da8da4
Down-bump gradle-intellij-plugin version to 0.4.13
ice-phoenix Jan 26, 2021
fb71e41
Down-bump gradle-intellij-plugin version to 0.4.6
ice-phoenix Jan 26, 2021
69444b5
Down-bump gradle wrapper version to 5.3
ice-phoenix Jan 26, 2021
bcd0b64
Down-bump versions some more
ice-phoenix Jan 26, 2021
e4f775f
Revert gradle-intellij-plugin version to 0.4.1
ice-phoenix Jan 26, 2021
aea7942
Attempt 2: fixing IntelliJ version to 2020.2 to avoid Java 11 require…
ice-phoenix Jan 26, 2021
a8cf9bc
Re-enable grammar tests
ice-phoenix Jan 26, 2021
79b942e
Fix for grammar testData dir copy
ice-phoenix Jan 26, 2021
71ae6d1
Add fresh antlrtree.txt files
ice-phoenix Jan 26, 2021
7c2aab4
Drop obsolete antlrtree.txt files after syncWithCompilerTests
ice-phoenix Jan 26, 2021
044a042
Green grammar tests
belyaev-mikhail Jan 28, 2021
8f73578
Add sealed interfaces and update when expression exhaustiveness rules
ice-phoenix Feb 4, 2021
ba9f417
Fix GLB -> LUB in type decaying
ice-phoenix Mar 1, 2021
d61db06
Add note about the least single common supertype in type approximation
ice-phoenix Mar 1, 2021
0cc23be
Drop SVN dependency from grammar README.md
ice-phoenix Mar 2, 2021
58fe6f2
Updates for 1.5: inline classes -> value classes
belyaev-mikhail Mar 22, 2021
83066e8
Updates for 1.5: value classes in grammar
belyaev-mikhail Mar 22, 2021
4d983db
Prepare for bintray EOL: remove most of bintray dependencies
belyaev-mikhail Mar 22, 2021
dcea4f1
Fix CI build
belyaev-mikhail Mar 22, 2021
6730c24
Fix test data for the grammar change
belyaev-mikhail Mar 22, 2021
950e096
Add UnsignedLiteral to syntax.md
SmelJey Apr 2, 2021
a9e2849
Fix order of suffixes in UnsignedLiteral
SmelJey Apr 3, 2021
254bdfc
Merge pull request #72 from SmelJey/develop
belyaev-mikhail Apr 3, 2021
eb8a999
Compound expansion sketch (see https://youtrack.jetbrains.com/issue/K…
belyaev-mikhail Apr 9, 2021
f89e130
Merge remote-tracking branch 'origin/develop' into develop
belyaev-mikhail Apr 9, 2021
b8f1382
Fix typo
androiddevnotes Apr 13, 2021
b34ac3e
Merge pull request #75 from awesome-kotlin/develop
ice-phoenix Apr 13, 2021
10d95ba
newlines are allowed in lineStringExpression closes #40 (#77)
drieks Apr 16, 2021
41ba453
Fill the missing parts about async programming with coroutines for Ko…
ice-phoenix May 13, 2021
3cee246
Add syncGrammarWithKotlinGrammarApache2Repo pseudo task
ice-phoenix May 13, 2021
4152414
belyaev: release review
belyaev-mikhail May 17, 2021
e79140a
akhin: release review
ice-phoenix May 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ You have several options on how to contribute.
1. Make a [pull request](https://github.com/Kotlin/kotlin-spec/pulls)
1. Drop an email to [Marat Akhin](mailto:[email protected]) or [Mikhail Belyaev](mailto:[email protected])

> Note: if doing a pull request, it should be based on the `develop` branch.

In any of these cases, if we are talking about semantic changes to the specification, please try to include not only the improvements themselves, but also the reasoning on why you believe such a change is needed.

> If we are talking about simple, but still very much appreciated improvements, e.g., fixing grammar, spelling or punctuation mistakes, no justification is required for those.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This repository contains the specification of the [Kotlin programming language](https://kotlinlang.org), which describes how parts of the language should function *in more detail*, as compared to a more traditional user documentation on the [Kotlin Website](https://kotlinlang.org/docs/reference/).

It would be most useful to those who are interested in how Kotlin works on a finer lever and how its features interoperate, e.g., language enthusiasts, compiler writers and Kotlin power-users.
It would be most useful to those who are interested in how Kotlin works on a finer level and how its features interoperate, e.g., language enthusiasts, compiler writers and Kotlin power-users.
However, if you are simply wondering, why some code you wrote works the way it does, this specification might help you get an answer to that.

Currently, the specification covers only what we call *Kotlin/Core*: fundamental parts of Kotlin which should function the same way irregardless of the underlying platform.
Expand Down Expand Up @@ -67,6 +67,8 @@ You can help us make the Kotlin specification better by one of the following way
1. Discuss the specification on the Kotlin [forums](https://discuss.kotlinlang.org/)
1. Drop an email to [Marat Akhin](mailto:[email protected]) or [Mikhail Belyaev](mailto:[email protected]) with your suggestions

> Note: if doing a pull request, it should be based on the `develop` branch.

We welcome any and all feedback to the specification, but may tweak, change or iterate with you on the contribution before including it in the specification.

Further details on how to contribute to the specification are available in [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import at.phatbl.shellexec.ShellExec

plugins {
id("at.phatbl.shellexec") version "1.1.3"
}
Expand Down Expand Up @@ -108,3 +110,8 @@ tasks.create<Delete>("clean") {

delete("$projectDir/build")
}

tasks.create<ShellExec>("syncGrammarWithKotlinGrammarApache2Repo") {
group = "internal"
command = """echo -e Run the following command: git checkout release \&\& git subtree push --prefix grammar/src/main/antlr [email protected]:Kotlin/kotlin-grammar-apache2 release"""
}
38 changes: 24 additions & 14 deletions docs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import at.phatbl.shellexec.ShellExec
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.nio.file.Paths
import java.net.URI

plugins {
application
id("kotlin") version "1.3.41"
id("kotlin") version "1.4.31"
id("at.phatbl.shellexec")
}

Expand All @@ -26,10 +27,10 @@ fun getScriptText(scriptName: String): String {

val res = with(StringBuilder()) {
append("PROJECT_DIR=$projectDir$ls")
if(disableTODOS) append("TODO_OPTION=--disable-todos$ls")
if (disableTODOS) append("TODO_OPTION=--disable-todos$ls")
else append("TODO_OPTION=--enable-todos$ls")

if(enableStaticMath) append("STATIC_MATH_OPTION=--enable-static-math$ls")
if (enableStaticMath) append("STATIC_MATH_OPTION=--enable-static-math$ls")
else append("STATIC_MATH_OPTION=--disable-static-math$ls")

append(buildTemplate)
Expand All @@ -39,23 +40,32 @@ fun getScriptText(scriptName: String): String {
}

repositories {
maven { setUrl("https://dl.bintray.com/vorpal-research/kotlin-maven") }
maven {
url = URI("https://maven.pkg.github.com/vorpal-research/kotlin-maven")
credentials {
username = "vorpal-reseacher"
password = "\u0031\u0030\u0062\u0037\u0064\u0066\u0031\u0032\u0063\u0064" +
"\u0035\u0034\u0038\u0037\u0034\u0065\u0030\u0034\u0035\u0035" +
"\u0038\u0031\u0063\u0039\u0039\u0062\u0031\u0066\u0032\u0030" +
"\u0038\u0065\u0031\u0061\u0035\u0033\u0065\u0036\u0032\u0038"
}
}
mavenCentral()
}

java.sourceSets {
"main" {
sourceSets {
main {
java.srcDir("src/main/kotlin")
}
}

dependencies {
compile("ru.spbstu:g4toEBNF:0.0.0.3")
compile("ru.spbstu:kotlin-pandoc:0.0.10")
compile("ru.spbstu:simple-diagrammer:0.0.0.6")
compile("com.github.ajalt:clikt:1.7.0")
compile("com.zaxxer:nuprocess:2.0.1")
compile("org.antlr:antlr4:4.+")
implementation("ru.spbstu:g4-to-ebnf:0.0.0.4")
implementation("ru.spbstu:kotlin-pandoc:0.0.13")
implementation("ru.spbstu:simple-diagrammer:0.0.0.7")
implementation("com.github.ajalt:clikt:1.7.0")
implementation("com.zaxxer:nuprocess:2.0.1")
implementation("org.antlr:antlr4:4.+")
}

tasks.withType<KotlinCompile> {
Expand Down Expand Up @@ -96,7 +106,7 @@ tasks.create<JavaExec>("convertGrammar") {

outputs.file(outputFile)

classpath = java.sourceSets["main"].runtimeClasspath
classpath = sourceSets["main"].runtimeClasspath
main = "org.jetbrains.kotlin.spec.ConvertGrammarKt"
args = listOf("-d", grammarsDir, "-l", lexerGrammar, "-p", parserGrammar, "-o", outputFile)
}
Expand Down Expand Up @@ -130,7 +140,7 @@ tasks.create<ShellExec>("buildHtmlBySections") {
tasks.create<JavaExec>("execute") {
group = "internal"

classpath = java.sourceSets["main"].runtimeClasspath
classpath = sourceSets["main"].runtimeClasspath

main = project.findProperty("mainClass") as? String ?: ""
args = (project.findProperty("args") as? String)?.split(" ") ?: emptyList()
Expand Down
Empty file modified docs/scripts/build/buildHtml.sh
100644 → 100755
Empty file.
Empty file modified docs/scripts/build/buildHtmlBySections.sh
100644 → 100755
Empty file.
Empty file modified docs/scripts/build/directories.sh
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions docs/src/md/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,5 @@

\opMathIT{\Assigned}{Assigned}
\opMathIT{\Unassigned}{Unassigned}

\newcommand{\coroutineSuspended}{\texttt{CO\-RO\-U\-TINE\-\_SUS\-PEN\-DED}}
32 changes: 28 additions & 4 deletions docs/src/md/kotlin.core/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,15 @@ Annotations may be declared *repeatable* (meaning that the same annotation may b
`kotlin.annotation.Repeatable` is an annotation which is only used on annotation classes to specify whether this particular annotation is repeatable.
Annotations are non-repeatable by default.

* `kotlin.Experimental` / `kotlin.UseExperimental`
* `kotlin.RequiresOptIn` / `kotlin.OptIn`

`kotlin.Experimental` is an annotation class with a single field:
`kotlin.RequiresOptIn` is an annotation class with two fields:

* ```kotlin
val message: String = ""
```

The message describing the particular opt-in requirements.

* ```kotlin
val level: Level = Level.ERROR
Expand All @@ -124,17 +130,19 @@ Annotations may be declared *repeatable* (meaning that the same annotation may b

This annotation is used to introduce implementation-defined experimental language or standard library features.

`kotlin.UseExperimental` is an annotation class with a single field:
`kotlin.OptIn` is an annotation class with a single field:

* ```kotlin
vararg val markerClass: KClass<out Annotation>
```

The classes which this annotation allows to use.

This annotation is used to explicitly mark declarations which use experimental features marked by `kotlin.Experimental`.
This annotation is used to explicitly mark declarations which use experimental features marked by `kotlin.RequiresOptIn`.

It is implementation-defined how this annotation is processed.

> Note: before Kotlin 1.4.0, there were two other built-in annotations: `@Experimental` (now replaced by `@RequiresOptIn`) and `@UseExperimental` (now replaced by `@OptIn`) serving the same purpose which are now deprecated.

TODO(Experimental status is still experimental itself)

Expand Down Expand Up @@ -226,3 +234,19 @@ Annotations may be declared *repeatable* (meaning that the same annotation may b
`kotlin.PublishedApi` is an annotation class with no fields which is applicable to any declaration.
It may be applied to any declaration with `internal` visibility to make it available to `public` `inline` declarations.
See [Declaration visibility section][Declaration visibility] for details.

* `kotlin.BuilderInference`

Marks the annotated function of function argument as eligible for [builder-style type inference][Builder-style type inference].
See corresponding section for details.

> Note: as of Kotlin 1.4.0, this annotation is experimental and, in order to use it in one's code, one must explicitly enable it using opt-in annotations given above.
> The particular marker class used to perform this is implementation-defined.

* `kotlin.RestrictSuspension`

In some cases we may want to limit which [suspending functions] can be called in another suspending function with an extension receiver of a specific type; i.e., if we want to provide a coroutine-enabled DSL, but disallow the use of arbitrary suspending functions.
To do so, the type `T` of that extension receiver needs to be annotated with `kotlin.RestrictSuspension`, which enables the following limitations.

* Suspending functions with an extention receiver of type `T` are restricted from calling other suspending functions besides those accessible on this receiver.
* Suspending functions of type `T` can be called only on an extention receiver.
14 changes: 12 additions & 2 deletions docs/src/md/kotlin.core/builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ It is the type of the result of [string interpolation][String interpolation expr

Contains the ordinal of this enumeration constant, i.e., its position in the declaration, starting from zero.

`kotlin.Enum<T>` provides the following methods.
`kotlin.Enum<T>` provides the following member functions.

* ```kotlin
public override final fun compareTo(other: T): Int
```

The implementation of `kotlin.Comparable`.
The result of `a.compareTo(b)` for enum class instances `a` and `b` is equivalent to `a.ordinal.compareTo(b.ordinal)`.

* ```kotlin
public override final fun equals(other: Any?): Boolean
Expand All @@ -197,13 +200,18 @@ It is the type of the result of [string interpolation][String interpolation expr
public override final fun hashCode(): Int
```

These methods are defined to their default behaviour: only the same entry of an enum class is equal to itself and no other object.
Hash implementation is required to be consistent, but unspecified.

> Note: the presence of these final methods ensures the semantics of equality and comparison for the enumeration objects, as they cannot be overridden by the user.

* ```kotlin
protected final fun clone(): Any
```

> Note: the `clone()` implementation throws an exception, as enumeration objects cannot be copied.
Throws an unspecified exception.

> Note: the `clone()` implementation throws an exception, as enumeration objects cannot be copied and on some platforms `clone` function serves for copying.

### Built-in array types

Expand All @@ -217,6 +225,8 @@ It is final (i.e., cannot be inherited from) and has the following public constr

Creates a new array with the specified size, where each element is calculated by calling the specified `init` function with the corresponding element's index.
The function `init` is called for each array element sequentially starting from the first one.
This constructor is special in two ways: first, it is `inline` and inline constructors are not generally allowed in Kotlin.
Second, it is required for the parameter `T` to be instantiated with a [runtime-available type][Runtime-available types].

`kotlin.Array<T>` provides the following methods and properties.

Expand Down
Loading