Skip to content
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

Proxies created by Import are undefined #316

Closed
costleya opened this issue Oct 29, 2018 · 1 comment
Closed

Proxies created by Import are undefined #316

costleya opened this issue Oct 29, 2018 · 1 comment
Assignees

Comments

@costleya
Copy link
Contributor

var artifactBucket = BucketRef.Import(this, "PipelineArtifactBucket", new BucketRefProps()
{
    BucketName = "TestBucket"
});
var pipeline = new Pipeline(this, "Pipeline", new PipelineProps
{
    ArtifactBucket = artifactBucket,
    RestartExecutionOnUpdate = true
});
Console.WriteLine(pipeline.ArtifactBucket.BucketName == artifactBucket.BucketName);

Returns False.

var codeCommit = RepositoryRef.Import(this, "CodeCommit", new RepositoryRefProps
{
    RepositoryName = "test-repo"
});
new PipelineSourceAction(this, "CodeCommitSourceAction",
    new PipelineSourceActionProps
    {
        Stage = sourceStage,
        Branch = "master",
        Repository = codeCommit
    });

Throws an exception - "Unhandled Exception: Amazon.JSII.Runtime.JsiiException: Cannot read property 'repositoryName' of undefined."

@costleya
Copy link
Contributor Author

The thrown are now "Interfaces should not used directly, bindings should use a proxy type" (paraphrase).

@costleya costleya self-assigned this Nov 13, 2018
@costleya costleya transferred this issue from aws/aws-cdk Nov 15, 2018
costleya added a commit to costleya/jsii that referenced this issue Nov 15, 2018
Proxy types when passed as parameters were throwing an exception in the dotnet runtime. Removing the check and throw did not have an
adverse effect on the runtime, so it was removed.

Compliance test added that passes an interface as a parameter.

Fixes aws#316
RomainMuller pushed a commit that referenced this issue Nov 15, 2018
#317)

Proxy types when passed as parameters were throwing an exception in the dotnet runtime. Removing the check and throw did not have an
adverse effect on the runtime, so it was removed.

Compliance test added that passes an interface as a parameter.

Fixes #316
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

No branches or pull requests

1 participant