mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 16:04:52 +01:00
25 lines
642 B
Plaintext
25 lines
642 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
|
|
// RUN: %{not} %{explorer-run}
|
|
// RUN: %{not} %{explorer-run-trace}
|
|
|
|
package ExplorerTest impl;
|
|
|
|
class A {
|
|
destructor[addr self: Self*] {
|
|
self->n += 1;
|
|
Print("DESTRUCTOR A {0}", self->n);
|
|
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/testdata/destructor/fail_addr.carbon:[[@LINE+1]]: destructors currently don't support `addr self` bindings
|
|
}
|
|
|
|
var n: i32;
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
var a: A = {.n = 2};
|
|
return 0;
|
|
}
|