Created
November 17, 2015 01:44
-
-
Save marcioAlmada/7dee0f27dcdb201d26ec to your computer and use it in GitHub Desktop.
second order macros FTR
This file contains hidden or 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
--TEST-- | |
Opaque types with macros that generate other macros :> | |
--FILE-- | |
<?php | |
macro { | |
type T_STRING·newtype = T_STRING·basetype; | |
} >> { | |
macro { T_STRING·newtype } >> { T_STRING·basetype } | |
} | |
type Username = string; | |
type Password = string; | |
function register_user(Username $nickname, Password $password) : User { | |
//... | |
} | |
?> | |
--EXPECTF-- | |
<?php | |
function register_user(string $nickname, string $password) : User { | |
//... | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment