-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0858e6
commit e375707
Showing
6 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//! > Test instantiation. | ||
|
||
//! > test_runner_name | ||
test_function_diagnostics(expect_diagnostics: true) | ||
|
||
//! > function | ||
fn foo() { | ||
MyStruct {}; | ||
MyEnum::a(3); | ||
} | ||
|
||
//! > function_name | ||
foo | ||
|
||
//! > module_code | ||
#[phantom] | ||
struct MyStruct {} | ||
|
||
#[phantom] | ||
enum MyEnum { | ||
a: felt252 | ||
} | ||
|
||
//! > expected_diagnostics | ||
error: Can not create instances of phantom types. | ||
--> lib.cairo:9:5 | ||
MyStruct {}; | ||
^*********^ | ||
|
||
error: Can not create instances of phantom types. | ||
--> lib.cairo:10:5 | ||
MyEnum::a(3); | ||
^**********^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters