mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Error evaluating symbolic tuple (#2957)
Reports an error (`value of generic binding T is not known`) instead of performing an invalid cast when attempting to index into a tuple. Can occur when trying to cast a generic constant in the interface position of an implementation to `type`. Closes #2938
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_impl_as_symbolic.carbon:[[@LINE+1]]: value of generic binding T is not known
|
||||
impl forall [T:! ({}, )] {} as T {
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
interface X {
|
||||
}
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_impl_symbolic_as.carbon:[[@LINE+1]]: value of generic binding Y is not known
|
||||
impl forall [Y:! (X, )] Y as true {
|
||||
}
|
||||
fn Main() -> i32 {
|
||||
}
|
||||
Reference in New Issue
Block a user