Skip to content

Commit

Permalink
add test showing value types rules are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Feb 20, 2024
1 parent a1f45e8 commit 85188b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/type_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ mod new_with_self_references;
mod permission_check;
mod subtyping;
mod type_check;
mod value_types;
mod value_type_permissions;
mod value_type_subtyping;
mod variance_subtyping;

/// Check what happens when we encounter a bad class name in a function parameter.
Expand Down
25 changes: 25 additions & 0 deletions src/type_system/tests/value_type_permissions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use formality_core::test;
use formality_core::test_util::ResultTestExt;

use crate::{dada_lang::term, type_system::check_program};

#[test]
#[ignore = "FIXME, broken"]
fn give_int_value_twice() {
check_program(&term(
"
class Foo {
i: Int;
}
class Main {
fn main(my self, foo: my Foo) {
foo.i.give;
foo.i.give;
();
}
}
",
))
.assert_ok(expect_test::expect![["()"]])
}
File renamed without changes.

0 comments on commit 85188b6

Please sign in to comment.