-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11359: Address the `cannot traverse union(...)` error when converting examples r=iwahbe a=iwahbe Fixes #11346 In every case I examined, the original error came from mis-typed PCL. The fix here allows us to continue without error, but it won't generate correctly typed code. This PR fixes a couple of different problems. 1. It improves the diagognostics, both within the binder and within the test framework. 2. It moves omitted errors to warnings (instead of dropping them). 3. It prevents rewrites on dynamic types, fixing the original error. Co-authored-by: Ian Wahbe <ian@wahbe.com>
- Loading branch information
Showing
18 changed files
with
181 additions
and
47 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...gen-dotnet-go-nodejs-python--dont-generate-traverse-error-when-typecheck-is-disabled.yaml
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,4 @@ | ||
changes: | ||
- type: fix | ||
scope: programgen/dotnet,go,nodejs,python | ||
description: Don't generate traverse errors when typechecking a dynamic type |
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
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
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
19 changes: 19 additions & 0 deletions
19
pkg/codegen/testing/test/testdata/traverse-union-repro-pp/dotnet/traverse-union-repro.cs
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,19 @@ | ||
using System.Collections.Generic; | ||
using Pulumi; | ||
using Aws = Pulumi.Aws; | ||
|
||
return await Deployment.RunAsync(() => | ||
{ | ||
var test = new Aws.Fsx.OpenZfsFileSystem("test", new() | ||
{ | ||
StorageCapacity = 64, | ||
SubnetIds = new[] | ||
{ | ||
aws_subnet.Test1.Id, | ||
}, | ||
DeploymentType = "SINGLE_AZ_1", | ||
ThroughputCapacity = 64, | ||
}); | ||
}); | ||
|
23 changes: 23 additions & 0 deletions
23
pkg/codegen/testing/test/testdata/traverse-union-repro-pp/go/traverse-union-repro.go
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,23 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/fsx" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func main() { | ||
pulumi.Run(func(ctx *pulumi.Context) error { | ||
_, err := fsx.NewOpenZfsFileSystem(ctx, "test", &fsx.OpenZfsFileSystemArgs{ | ||
StorageCapacity: pulumi.Int(64), | ||
SubnetIds: pulumi.String{ | ||
aws_subnet.Test1.Id, | ||
}, | ||
DeploymentType: pulumi.String("SINGLE_AZ_1"), | ||
ThroughputCapacity: pulumi.Int(64), | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
}) | ||
} |
9 changes: 9 additions & 0 deletions
9
pkg/codegen/testing/test/testdata/traverse-union-repro-pp/nodejs/traverse-union-repro.ts
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,9 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as aws from "@pulumi/aws"; | ||
|
||
const test = new aws.fsx.OpenZfsFileSystem("test", { | ||
storageCapacity: 64, | ||
subnetIds: [aws_subnet.test1.id], | ||
deploymentType: "SINGLE_AZ_1", | ||
throughputCapacity: 64, | ||
}); |
Oops, something went wrong.