mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 14:51:03 +01:00
The presence or absence of whitespace is used to determine which operator is in use, following the rules described in #520. Support for prefix * dereference operator follows #523. Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
d6b47ba10f
commit
89e21113c3
+16
@@ -0,0 +1,16 @@
|
||||
// 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
|
||||
|
||||
// Never actually called, so this only tests typechecking and semantic analysis.
|
||||
fn F(n: Int, p: Int*, q: Int***) -> Int* {
|
||||
var a: Int = n * *p;
|
||||
var b: Int = a*n;
|
||||
*p = b*(*p);
|
||||
**q = p;
|
||||
return **q;
|
||||
}
|
||||
|
||||
fn main() -> Int {
|
||||
return 0;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
result: 0
|
||||
Reference in New Issue
Block a user