@@ -342,9 +342,9 @@ public void CommaSeparatedList (IEnumerable<object> values, TypeReferenceContext
342342 else if ( valueType == ListValueType . Identifier )
343343 Identifier ( value as dynamic , context ) ;
344344 else if ( valueType == ListValueType . TypeIdentifier )
345- TypeIdentifier ( value as dynamic , context , false ) ;
345+ TypeIdentifier ( value as dynamic , context , false , false ) ;
346346 else if ( valueType == ListValueType . TypeReference )
347- TypeReference ( ( TypeReference ) value , context ) ;
347+ TypeReference ( ( TypeReference ) value , context ) ;
348348 else
349349 WriteRaw ( value . ToString ( ) ) ;
350350 } ,
@@ -528,14 +528,14 @@ protected void TypeReferenceInternal (GenericParameter gp, TypeReferenceContext
528528 }
529529 return ;
530530 } else {
531- TypeIdentifier ( resolved , context , false ) ;
531+ TypeIdentifier ( resolved , context , false , true ) ;
532532 return ;
533533 }
534534 }
535535 }
536536
537537 if ( TypeUtil . TypesAreEqual ( ownerType , context . EnclosingMethodType ) ) {
538- TypeIdentifier ( gp , context , false ) ;
538+ TypeIdentifier ( gp , context , false , true ) ;
539539 return ;
540540 }
541541
@@ -871,11 +871,11 @@ public void Identifier (TypeReference type, TypeReferenceContext context, bool i
871871 if ( type . FullName == "JSIL.Proxy.AnyType" )
872872 WriteRaw ( "JSIL.AnyType" ) ;
873873 else
874- TypeIdentifier ( type as dynamic , context , includeParens ) ;
874+ TypeIdentifier ( type as dynamic , context , includeParens , true ) ;
875875 }
876876
877- protected void TypeIdentifier ( TypeInfo type , TypeReferenceContext context , bool includeParens ) {
878- TypeIdentifier ( type . Definition as dynamic , context , includeParens ) ;
877+ protected void TypeIdentifier ( TypeInfo type , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
878+ TypeIdentifier ( type . Definition as dynamic , context , includeParens , usePublicInterface ) ;
879879 }
880880
881881 protected bool EmitThisForParameter ( GenericParameter gp ) {
@@ -891,7 +891,7 @@ protected bool EmitThisForParameter (GenericParameter gp) {
891891 return false ;
892892 }
893893
894- protected void TypeIdentifier ( TypeReference type , TypeReferenceContext context , bool includeParens ) {
894+ protected void TypeIdentifier ( TypeReference type , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
895895 if ( SignatureCacher . IsTypeArgument ( type ) ) {
896896 WriteRaw ( type . Name ) ;
897897 return ;
@@ -939,7 +939,14 @@ protected void TypeIdentifier (TypeReference type, TypeReferenceContext context,
939939
940940 Identifier ( type . FullName ) ;
941941 }
942- } else {
942+
943+ if ( usePublicInterface )
944+ {
945+ Dot ( ) ;
946+ WriteRaw ( "__PublicInterface__" ) ;
947+ }
948+ }
949+ else {
943950 var info = TypeInfo . Get ( type ) ;
944951 if ( ( info != null ) && ( info . Replacement != null ) ) {
945952 WriteRaw ( info . Replacement ) ;
@@ -967,16 +974,21 @@ protected void TypeIdentifier (TypeReference type, TypeReferenceContext context,
967974 type . FullName , EscapingMode . TypeIdentifier
968975 ) ) ;
969976 }
977+
978+ if ( ! usePublicInterface ) {
979+ Dot ( ) ;
980+ WriteRaw ( "__Type__" ) ;
981+ }
970982 }
971983 }
972984
973- protected void TypeIdentifier ( ByReferenceType type , TypeReferenceContext context , bool includeParens ) {
985+ protected void TypeIdentifier ( ByReferenceType type , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
974986 if ( includeParens )
975987 LPar ( ) ;
976988
977989 WriteRaw ( "JSIL.Reference.Of" ) ;
978990 LPar ( ) ;
979- TypeIdentifier ( type . ElementType as dynamic , context , false ) ;
991+ TypeIdentifier ( type . ElementType as dynamic , context , false , true ) ;
980992 RPar ( ) ;
981993
982994 if ( includeParens ) {
@@ -985,13 +997,13 @@ protected void TypeIdentifier (ByReferenceType type, TypeReferenceContext contex
985997 }
986998 }
987999
988- protected void TypeIdentifier ( ArrayType type , TypeReferenceContext context , bool includeParens ) {
1000+ protected void TypeIdentifier ( ArrayType type , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
9891001 if ( includeParens )
9901002 LPar ( ) ;
9911003
9921004 WriteRaw ( "System.Array.Of" ) ;
9931005 LPar ( ) ;
994- TypeIdentifier ( type . ElementType as dynamic , context , false ) ;
1006+ TypeIdentifier ( type . ElementType as dynamic , context , false , true ) ;
9951007 if ( ! type . IsVector )
9961008 {
9971009 Comma ( ) ;
@@ -1001,29 +1013,33 @@ protected void TypeIdentifier (ArrayType type, TypeReferenceContext context, boo
10011013 RPar ( ) ;
10021014 }
10031015 RPar ( ) ;
1016+ if ( ! usePublicInterface ) {
1017+ Dot ( ) ;
1018+ WriteRaw ( "__Type__" ) ;
1019+ }
10041020
10051021 if ( includeParens ) {
10061022 RPar ( ) ;
10071023 Space ( ) ;
10081024 }
10091025 }
10101026
1011- protected void TypeIdentifier ( OptionalModifierType modopt , TypeReferenceContext context , bool includeParens ) {
1027+ protected void TypeIdentifier ( OptionalModifierType modopt , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
10121028 Identifier ( modopt . ElementType as dynamic , context , includeParens ) ;
10131029 }
10141030
1015- protected void TypeIdentifier ( RequiredModifierType modreq , TypeReferenceContext context , bool includeParens ) {
1031+ protected void TypeIdentifier ( RequiredModifierType modreq , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
10161032 Identifier ( modreq . ElementType as dynamic , context , includeParens ) ;
10171033 }
10181034
1019- protected void TypeIdentifier ( PointerType ptr , TypeReferenceContext context , bool includeParens ) {
1035+ protected void TypeIdentifier ( PointerType ptr , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
10201036 WriteRaw ( "JSIL.Pointer.Of" ) ;
10211037 LPar ( ) ;
10221038 Identifier ( ptr . ElementType as dynamic , context , includeParens ) ;
10231039 RPar ( ) ;
10241040 }
10251041
1026- protected void TypeIdentifier ( GenericInstanceType type , TypeReferenceContext context , bool includeParens ) {
1042+ protected void TypeIdentifier ( GenericInstanceType type , TypeReferenceContext context , bool includeParens , bool usePublicInterface ) {
10271043 if ( includeParens )
10281044 LPar ( ) ;
10291045
@@ -1034,6 +1050,10 @@ protected void TypeIdentifier (GenericInstanceType type, TypeReferenceContext co
10341050 LPar ( ) ;
10351051 CommaSeparatedList ( type . GenericArguments , context , ListValueType . TypeIdentifier ) ;
10361052 RPar ( ) ;
1053+ if ( ! usePublicInterface ) {
1054+ Dot ( ) ;
1055+ WriteRaw ( "__Type__" ) ;
1056+ }
10371057
10381058 if ( includeParens ) {
10391059 RPar ( ) ;
@@ -1330,7 +1350,7 @@ public void Signature (MethodReference method, MethodSignature signature, TypeRe
13301350 : signature . ReturnType ;
13311351
13321352 if ( ( alwaysUseIdentifiers || context . EnclosingMethod != null ) && ! TypeUtil . IsOpenType ( returnType , gp => ! SignatureCacher . IsTypeArgument ( gp ) ) )
1333- TypeIdentifier ( returnType as dynamic , context , false ) ;
1353+ TypeIdentifier ( returnType as dynamic , context , false , true ) ;
13341354 else
13351355 TypeReference ( returnType , context ) ;
13361356
@@ -1340,7 +1360,7 @@ public void Signature (MethodReference method, MethodSignature signature, TypeRe
13401360 WriteRaw ( "null" ) ;
13411361 else {
13421362 if ( ( alwaysUseIdentifiers || context . EnclosingMethod != null ) && ! TypeUtil . IsOpenType ( signature . ReturnType , gp => ! SignatureCacher . IsTypeArgument ( gp ) ) )
1343- TypeIdentifier ( signature . ReturnType as dynamic , context , false ) ;
1363+ TypeIdentifier ( signature . ReturnType as dynamic , context , false , true ) ;
13441364 else
13451365 TypeReference ( signature . ReturnType , context ) ;
13461366 }
@@ -1353,7 +1373,7 @@ public void Signature (MethodReference method, MethodSignature signature, TypeRe
13531373 CommaSeparatedListCore (
13541374 signature . ParameterTypes , ( pt ) => {
13551375 if ( ( alwaysUseIdentifiers || context . EnclosingMethod != null ) && ! TypeUtil . IsOpenType ( pt , gp => ! SignatureCacher . IsTypeArgument ( gp ) ) )
1356- TypeIdentifier ( pt as dynamic , context , false ) ;
1376+ TypeIdentifier ( pt as dynamic , context , false , true ) ;
13571377 else
13581378 TypeReference ( pt , context ) ;
13591379 }
0 commit comments