Add test for var with inferred non-constructible type
Follow up to this bugfix: https://dawn-review.googlesource.com/c/tint/+/61660 Change-Id: I357e1fd859c844c3285ea6077c0e58d225e01c6e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/61682 Auto-Submit: James Price <jrprice@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
b73a12cc5d
commit
67473c7a6c
|
@ -327,6 +327,20 @@ TEST_F(ResolverVarLetValidationTest, NonConstructibleType_Struct_WithAtomic) {
|
||||||
"error: function variable must have a constructible type");
|
"error: function variable must have a constructible type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ResolverVarLetValidationTest, NonConstructibleType_InferredType) {
|
||||||
|
// [[group(0), binding(0)]] var s : sampler;
|
||||||
|
// fn foo() {
|
||||||
|
// var v = s;
|
||||||
|
// }
|
||||||
|
Global("s", ty.sampler(ast::SamplerKind::kSampler), GroupAndBinding(0, 0));
|
||||||
|
auto* v = Var(Source{{12, 34}}, "v", nullptr, Expr("s"));
|
||||||
|
WrapInFunction(v);
|
||||||
|
|
||||||
|
EXPECT_FALSE(r()->Resolve());
|
||||||
|
EXPECT_EQ(r()->error(),
|
||||||
|
"12:34 error: function variable must have a constructible type");
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace resolver
|
} // namespace resolver
|
||||||
} // namespace tint
|
} // namespace tint
|
||||||
|
|
Loading…
Reference in New Issue