Skip to content

Commit

Permalink
test: add test-case for unary of non-generic function
Browse files Browse the repository at this point in the history
  • Loading branch information
junlarsen committed Feb 6, 2025
1 parent 6159525 commit 37453ff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/hir/type/unary-op-expr/unary-of-function-reference.eight
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
// RUN: %not %eightc %s 2>&1 | %fc %s

trait Neg<A, R> {
fn neg(a: A) -> R;
}

intrinsic_fn garbage(v: i32) -> i32;

fn test(a: i32) -> i32 {
let k = -garbage;
return 0;
}

// CHECK-LABEL: sema::trait_missing_instance
// CHECK: trait Neg does not have instance Neg<fn(i32) -> i32, _>

0 comments on commit 37453ff

Please sign in to comment.