Skip to content

Commit

Permalink
chore: self mutation (e2e-2of2.diff)
Browse files Browse the repository at this point in the history
Signed-off-by: monada-bot[bot] <[email protected]>
  • Loading branch information
monadabot committed Apr 11, 2024
1 parent 87f7219 commit b95e22e
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 51 deletions.
185 changes: 137 additions & 48 deletions tools/hangar/__snapshots__/invalid.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1417,69 +1417,76 @@ Duration <DURATION>"
`;

exports[`explicit_lift_qualification.test.w 1`] = `
"error: Expected type to be \\"Resource\\", but got \\"str\\" instead
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:14:10
"error: Expected type to be \\"IResource\\", but got \\"str\\" instead
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:22:10
|
14 | lift(prelight_string, [\\"contains\\"]); // Explicit qualification on preflight non-class
| ^^^^^^^^^^^^^^^ Expected type to be \\"Resource\\", but got \\"str\\" instead
22 | lift(prelight_string, [\\"contains\\"]); // Explicit qualification on preflight non-class
| ^^^^^^^^^^^^^^^ Expected type to be \\"IResource\\", but got \\"str\\" instead


error: lift() calls must be at the top of the method
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:10:5
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:18:5
|
10 | lift(b, [\\"put\\"]); // Explicit qualification with inflight object, lift call as non first statement
18 | lift(b, [\\"put\\"]); // Explicit qualification with inflight object, lift call as non first statement
| ^^^^^^^^^^^^^^^^^ lift() calls must be at the top of the method


error: lift() calls must be at the top of the method
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:14:5
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:22:5
|
14 | lift(prelight_string, [\\"contains\\"]); // Explicit qualification on preflight non-class
22 | lift(prelight_string, [\\"contains\\"]); // Explicit qualification on preflight non-class
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lift() calls must be at the top of the method


error: lift() calls must be at the top of the method
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:19:5
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:27:5
|
19 | lift(bucket, [inflight_qualifier]); // Explicit qualification with inflight qualifiers, lift call as non first statement
27 | lift(bucket, [inflight_qualifier]); // Explicit qualification with inflight qualifiers, lift call as non first statement
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lift() calls must be at the top of the method


error: Expected a preflight object as first argument to \`lift\` builtin, found inflight expression instead
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:10:10
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:18:10
|
10 | lift(b, [\\"put\\"]); // Explicit qualification with inflight object, lift call as non first statement
18 | lift(b, [\\"put\\"]); // Explicit qualification with inflight object, lift call as non first statement
| ^ Expected a preflight object as first argument to \`lift\` builtin, found inflight expression instead


error: Qualification list must not contain any inflight elements
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:19:18
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:27:18
|
19 | lift(bucket, [inflight_qualifier]); // Explicit qualification with inflight qualifiers, lift call as non first statement
27 | lift(bucket, [inflight_qualifier]); // Explicit qualification with inflight qualifiers, lift call as non first statement
| ^^^^^^^^^^^^^^^^^^^^ Qualification list must not contain any inflight elements


error: lift() calls are only allowed in inflight methods and closures defined in preflight
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:24:7
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:32:7
|
24 | lift(bucket, [\\"get\\"]); // lift() call in inner closure
32 | lift(bucket, [\\"get\\"]); // lift() call in inner closure
| ^^^^^^^^^^^^^^^^^^^^^^ lift() calls are only allowed in inflight methods and closures defined in preflight


error: lift() calls are only allowed in inflight methods and closures defined in preflight
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:29:9
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:37:9
|
29 | lift(bucket, [\\"get\\"]); // lift() call in inner class
37 | lift(bucket, [\\"get\\"]); // lift() call in inner class
| ^^^^^^^^^^^^^^^^^^^^^^ lift() calls are only allowed in inflight methods and closures defined in preflight


error: Expression of type \\"Bucket\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:37:5
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:45:5
|
37 | b.put(\\"k\\", \\"v\\"); // With no explicit qualification this should be an error
45 | b.put(\\"k\\", \\"v\\"); // With no explicit qualification this should be an error
| ^ Expression of type \\"Bucket\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.


error: Expression of type \\"IPreflightInterface\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.
--> ../../../examples/tests/invalid/explicit_lift_qualification.test.w:49:5
|
49 | i.method(); // With no explicit qualification this should be an error
| ^ Expression of type \\"IPreflightInterface\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.




Tests 1 failed (1)
Expand Down Expand Up @@ -2000,10 +2007,10 @@ exports[`impl_interface.test.w 1`] = `


error: Expected type to be \\"inflight (message: str): void\\", but got \\"inflight (x: num): void\\" instead
--> ../../../examples/tests/invalid/impl_interface.test.w:7:7
--> ../../../examples/tests/invalid/impl_interface.test.w:8:16
|
7 | class B impl cloud.IQueueSetConsumerHandler {
| ^ Expected type to be \\"inflight (message: str): void\\", but got \\"inflight (x: num): void\\" instead
8 | pub inflight handle(x: num) {
| ^^^^^^ Expected type to be \\"inflight (message: str): void\\", but got \\"inflight (x: num): void\\" instead


error: Expected an interface, instead found type \\"Bucket\\"
Expand Down Expand Up @@ -2316,13 +2323,38 @@ Duration <DURATION>"
`;

exports[`inflight_class_interface_structural_typing.test.w 1`] = `
"error: Expected type to be \\"IGoo\\", but got \\"NotGoo\\" instead
"error: Inflight class YesGoo cannot implement a preflight interface IGoo
--> ../../../examples/tests/invalid/inflight_class_interface_structural_typing.test.w:15:3
|
15 | / inflight class YesGoo impl IGoo {
16 | | pub notHandle(): void {
17 | | log(\\"i am goo\\");
18 | | }
19 | | }
| \\\\---^ Inflight class YesGoo cannot implement a preflight interface IGoo


error: Expected type to be \\"IGoo\\", but got \\"NotGoo\\" instead
--> ../../../examples/tests/invalid/inflight_class_interface_structural_typing.test.w:26:17
|
26 | let x: IGoo = new NotGoo();
| ^^^^^^^^^^^^ Expected type to be \\"IGoo\\", but got \\"NotGoo\\" instead


error: Expression of type \\"IGoo\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.
--> ../../../examples/tests/invalid/inflight_class_interface_structural_typing.test.w:23:3
|
23 | y.notHandle();
| ^ Expression of type \\"IGoo\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.


error: Expression of type \\"IGoo\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.
--> ../../../examples/tests/invalid/inflight_class_interface_structural_typing.test.w:27:3
|
27 | x.notHandle();
| ^ Expression of type \\"IGoo\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.




Tests 1 failed (1)
Expand Down Expand Up @@ -2435,80 +2467,137 @@ Duration <DURATION>"

exports[`interface.test.w 1`] = `
"error: Properties are not supported in interfaces
--> ../../../examples/tests/invalid/interface.test.w:30:3
--> ../../../examples/tests/invalid/interface.test.w:32:3
|
30 | bar: str;
32 | bar: str;
| ^^^^^^^^^ Properties are not supported in interfaces


error: Access modifiers are not allowed in interfaces
--> ../../../examples/tests/invalid/interface.test.w:36:3
--> ../../../examples/tests/invalid/interface.test.w:38:3
|
36 | pub method2(): str;
38 | pub method2(): str;
| ^^^^^^^^^^^^^^^^^^^ Access modifiers are not allowed in interfaces


error: Expected type annotation
--> ../../../examples/tests/invalid/interface.test.w:42:11
--> ../../../examples/tests/invalid/interface.test.w:44:11
|
42 | method1(a, b): void;
44 | method1(a, b): void;
| ^ Expected type annotation


error: Expected type annotation
--> ../../../examples/tests/invalid/interface.test.w:42:14
--> ../../../examples/tests/invalid/interface.test.w:44:14
|
42 | method1(a, b): void;
44 | method1(a, b): void;
| ^ Expected type annotation


error: Unknown parser error
--> ../../../examples/tests/invalid/interface.test.w:36:14
--> ../../../examples/tests/invalid/interface.test.w:38:14
|
36 | pub method2(): str;
38 | pub method2(): str;
| ^^ Unknown parser error


error: Unknown symbol \\"IB\\"
--> ../../../examples/tests/invalid/interface.test.w:2:22
--> ../../../examples/tests/invalid/interface.test.w:4:22
|
2 | interface IA extends IB {
4 | interface IA extends IB {
| ^^ Unknown symbol \\"IB\\"


error: Unknown symbol \\"IDontExist\\"
--> ../../../examples/tests/invalid/interface.test.w:10:26
--> ../../../examples/tests/invalid/interface.test.w:12:26
|
10 | interface IExist extends IDontExist {
12 | interface IExist extends IDontExist {
| ^^^^^^^^^^ Unknown symbol \\"IDontExist\\"


error: Unknown symbol \\"ISomeClass\\"
--> ../../../examples/tests/invalid/interface.test.w:16:34
--> ../../../examples/tests/invalid/interface.test.w:18:34
|
16 | interface ISomeInterface extends ISomeClass {
18 | interface ISomeInterface extends ISomeClass {
| ^^^^^^^^^^ Unknown symbol \\"ISomeClass\\"


error: Symbol \\"foo\\" already defined in this scope
--> ../../../examples/tests/invalid/interface.test.w:23:5
--> ../../../examples/tests/invalid/interface.test.w:25:5
|
22 | foo(): void;
24 | foo(): void;
| --- previous definition
23 | foo(): void;
25 | foo(): void;
| ^^^ Symbol \\"foo\\" already defined in this scope


error: Symbol \\"foo\\" already defined in this scope
--> ../../../examples/tests/invalid/interface.test.w:25:5
--> ../../../examples/tests/invalid/interface.test.w:27:5
|
22 | foo(): void;
24 | foo(): void;
| --- previous definition
.
25 | foo(): num;
27 | foo(): num;
| ^^^ Symbol \\"foo\\" already defined in this scope


error: Inflight class CImplPreflightIface cannot implement a preflight interface IPreflight
--> ../../../examples/tests/invalid/interface.test.w:52:1
|
52 | / inflight class CImplPreflightIface impl IPreflight {
53 | | pub method1(): void {}
54 | | }
| \\\\-^ Inflight class CImplPreflightIface cannot implement a preflight interface IPreflight


error: Expected type to be \\"preflight (): void\\", but got \\"inflight (): void\\" instead
--> ../../../examples/tests/invalid/interface.test.w:53:7
|
53 | pub method1(): void {}
| ^^^^^^^ Expected type to be \\"preflight (): void\\", but got \\"inflight (): void\\" instead
|
= hint: expected phase to be preflight, but got inflight instead


error: Inflight interface IInflightExtendsPreflight cannot extend a preflight interface IPreflight
--> ../../../examples/tests/invalid/interface.test.w:57:20
|
57 | inflight interface IInflightExtendsPreflight extends IPreflight {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ Inflight interface IInflightExtendsPreflight cannot extend a preflight interface IPreflight


error: Inflight interface IInflightExtendsJsii cannot extend a preflight interface ISomeInterface
--> ../../../examples/tests/invalid/interface.test.w:62:20
|
62 | inflight interface IInflightExtendsJsii extends jsii_fixture.ISomeInterface {
| ^^^^^^^^^^^^^^^^^^^^ Inflight interface IInflightExtendsJsii cannot extend a preflight interface ISomeInterface


error: Interface \\"IInflightExtendsJsii\\" extends \\"ISomeInterface\\" but has a conflicting member \\"method\\" (preflight (): void != inflight (): void)
--> ../../../examples/tests/invalid/interface.test.w:62:20
|
62 | inflight interface IInflightExtendsJsii extends jsii_fixture.ISomeInterface {
| ^^^^^^^^^^^^^^^^^^^^ Interface \\"IInflightExtendsJsii\\" extends \\"ISomeInterface\\" but has a conflicting member \\"method\\" (preflight (): void != inflight (): void)


error: Inflight class CInflightImplJsii cannot implement a preflight interface ISomeInterface
--> ../../../examples/tests/invalid/interface.test.w:67:1
|
67 | / inflight class CInflightImplJsii impl jsii_fixture.ISomeInterface {
68 | | pub method(): void {}
69 | | }
| \\\\-^ Inflight class CInflightImplJsii cannot implement a preflight interface ISomeInterface


error: Expected type to be \\"preflight (): void\\", but got \\"inflight (): void\\" instead
--> ../../../examples/tests/invalid/interface.test.w:68:7
|
68 | pub method(): void {}
| ^^^^^^ Expected type to be \\"preflight (): void\\", but got \\"inflight (): void\\" instead
|
= hint: expected phase to be preflight, but got inflight instead




Tests 1 failed (1)
Expand Down Expand Up @@ -3486,9 +3575,9 @@ Duration <DURATION>"

exports[`resource_captures.test.w 1`] = `
"error: Expression of type \\"Bucket\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.
--> ../../../examples/tests/invalid/resource_captures.test.w:15:5
--> ../../../examples/tests/invalid/resource_captures.test.w:14:5
|
15 | b.put(\\"hello\\", \\"world\\");
14 | b.put(\\"hello\\", \\"world\\");
| ^ Expression of type \\"Bucket\\" references an unknown preflight object, can't qualify its capabilities. Use \`lift()\` to explicitly qualify the preflight object to disable this error.


Expand Down
Loading

0 comments on commit b95e22e

Please sign in to comment.