mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Alias and distinct types didn't check the underlying type wasn't compile time or optional.
This commit is contained in:
13
test/test_suite/types/bad_typedefs.c3
Normal file
13
test/test_suite/types/bad_typedefs.c3
Normal file
@@ -0,0 +1,13 @@
|
||||
module test;
|
||||
import std;
|
||||
|
||||
struct Foo { struct x { int a; } }
|
||||
alias Floo = $typeof(Foo.x); // #error: You cannot create an alias for a member reference as it is a compile time type
|
||||
alias Void = void?; // #error: You cannot create an alias for an optional type
|
||||
typedef Floo2 = $typeof(Foo.x); // #error: You cannot create a distinct type for a member reference
|
||||
typedef Void2 = void?; // #error: You cannot create a distinct type from
|
||||
|
||||
fn void main()
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user