Files
carbon-lang/explorer/testdata/optional/fail_optional_get_empty.carbon
T
Prabhat Sachdeva 2f70c7d8bb Explorer: Reduce prelude path when printing source location (#3080)
The Prelude path can be very long, which can make the `SourceLocation`'s
`Print(...)` method output unnecessarily verbose. This PR modifies the
`SourceLocation`'s `Print()` method to just print the **filename** and
**line number** for prelude.
2023-08-09 17:57:07 +00:00

14 lines
422 B
Plaintext

// 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
// CHECK:STDERR: RUNTIME ERROR: prelude.carbon:{{\d+}}: "Attempted to unwrap empty Optional"
package ExplorerTest api;
fn Main() -> i32{
var x: Optional(i32) = Optional(i32).CreateEmpty();
return x.Get();
}