Skip to content

Conversation

@kggilmer
Copy link
Contributor

Issue #, if available: smithy-lang/smithy-kotlin#116

Companion PR: smithy-lang/smithy-kotlin#405

Description of changes:

  • Remove wildcard imports of runtime types
  • Add symbols for runtime types as needed for codegen

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines 44 to 62
object Internal {
val CredentialScope = buildSymbol {
name = "CredentialScope"
namespace(AwsKotlinDependency.AWS_CLIENT_RT_CORE, subpackage = "endpoint.internal")
}
val EndpointDefinition = buildSymbol {
name = "EndpointDefinition"
namespace(AwsKotlinDependency.AWS_CLIENT_RT_CORE, subpackage = "endpoint.internal")
}
val Partition = buildSymbol {
name = "Partition"
namespace(AwsKotlinDependency.AWS_CLIENT_RT_CORE, subpackage = "endpoint.internal")
}
val resolveEndpoint = buildSymbol {
name = "resolveEndpoint"
namespace(AwsKotlinDependency.AWS_CLIENT_RT_CORE, subpackage = "endpoint.internal")
}
val allSymbols = setOf(CredentialScope, EndpointDefinition, Partition, resolveEndpoint)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: To remove boilerplate, you could write a convenience function:

object Internal {
    private fun internalSymbol(name: String) = buildSymbol {
        this.name = name
        namespace(AwsKotlinDependency.AWS_CLIENT_RT_CORE, subpackage = "endpoint.internal")
    }

    val CredentialScope = internalSymbol("CredentialScope")
    val EndpointDefinition = internalSymbol("EndpointDefinition")
    val Partition = internalSymbol("Partition")
    val resolveEndpoint = internalSymbol("resolveEndpoint")
    val allSymbols = setOf(CredentialScope, EndpointDefinition, Partition, resolveEndpoint)
}

@kggilmer kggilmer merged commit 6cff241 into main Jun 16, 2021
@kggilmer kggilmer deleted the fix-disambiguate-sdk-types branch June 16, 2021 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants