-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make experimental Kotlin features optional for consumers.
Previously, we were using two experimental features of Kotlin, in different ways: * Unsigned types, both as API-level types and for some internal helpers. * The `buildMap` function, for easily building a Map. Both of these were emitted as part of the generated Kotlin code, regardless of whether the component actually needed them. In the first case, consumers would get a warning that they need to opt-in to using experimental unsigned types, even if the API they were consuming did not use any unsigned types. In the second case, we were silently opting in to an experimental API, meaning that consumers might find the generated code broken by a future Kotlin release without any warning. This commit removes default-on experimental Kotlin APIs. Now, the only time Kotlin consumers will hear about experimental APIs is if they're using a component with unsigned integers in its public API, in which case they will need to explicitly opt in (and hence will be aware of the potential for bustage if the feature gets removed or changed in future Kotlin releases). The key here was to refactor the ways the `ComponentInterface` deals with types, so that we can inspect the set of types that are actually used by the interface and emit only the code required for those types. This is encapsulated in a new `TypeUniverse` struct whose job is to maintain that whole-interface view of the set of types in use.
- Loading branch information
Showing
8 changed files
with
561 additions
and
416 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,3 @@ anyhow = "1" | |
askama = "0.10" | ||
heck = "0.3" | ||
clap = "2" | ||
serde = "1" |
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.