@@ -164,7 +164,7 @@ private static bool TryCreateInstantiationInvocation(AbstractPhaseContext contex
164
164
switch ( symbol . Name )
165
165
{
166
166
case "Instantiate_Extern" when symbol . ContainingType == context . GetTypeSymbol ( typeof ( InstantiationShim ) ) :
167
- createdInvocation = new BoundExternInvocation ( node ,
167
+ createdInvocation = new BoundExternInvocation ( node , context ,
168
168
new ExternSynthesizedMethodSymbol ( context ,
169
169
"VRCInstantiate.__Instantiate__UnityEngineGameObject__UnityEngineGameObject" ,
170
170
parameterExpressions . Select ( e => e . ValueType ) . ToArray ( ) ,
@@ -213,7 +213,7 @@ private static bool TryCreateSetProgramVariableInvocation(AbstractPhaseContext c
213
213
. GetMembers < MethodSymbol > ( "SetProgramVariable" , context )
214
214
. First ( e => ! e . RoslynSymbol . IsGenericMethod ) ;
215
215
216
- createdInvocation = new BoundExternInvocation ( node , setProgramVarObjMethod , instanceExpression ,
216
+ createdInvocation = new BoundExternInvocation ( node , context , setProgramVarObjMethod , instanceExpression ,
217
217
parameterExpressions ) ;
218
218
return true ;
219
219
}
@@ -233,7 +233,7 @@ private static bool TryCreateArrayMethodInvocation(AbstractPhaseContext context,
233
233
. GetMembers < MethodSymbol > ( symbol . Name , context )
234
234
. First ( e => ! e . RoslynSymbol . IsGenericMethod && e . Parameters . Length == symbol . Parameters . Length ) ;
235
235
236
- createdInvocation = new BoundExternInvocation ( node , arrayMethod , instanceExpression ,
236
+ createdInvocation = new BoundExternInvocation ( node , context , arrayMethod , instanceExpression ,
237
237
parameterExpressions ) ;
238
238
return true ;
239
239
}
@@ -249,7 +249,7 @@ private static bool TryCreateTMPMethodInvocation(AbstractPhaseContext context, S
249
249
if ( symbol . ContainingType != null &&
250
250
symbol . ContainingType . ToString ( ) == "TMPro.TMP_Text" )
251
251
{
252
- createdInvocation = new BoundExternInvocation ( node ,
252
+ createdInvocation = new BoundExternInvocation ( node , context ,
253
253
new ExternSynthesizedMethodSymbol ( context , symbol . Name , instanceExpression . ValueType , symbol . Parameters . Select ( e => e . Type ) . ToArray ( ) , symbol . ReturnType , symbol . IsStatic ) ,
254
254
instanceExpression ,
255
255
parameterExpressions ) ;
@@ -269,7 +269,7 @@ private static bool TryCreateBaseEnumMethodInvocation(AbstractPhaseContext conte
269
269
symbol . ContainingType != null &&
270
270
symbol . ContainingType == context . GetTypeSymbol ( SpecialType . System_Enum ) )
271
271
{
272
- createdInvocation = new BoundExternInvocation ( node ,
272
+ createdInvocation = new BoundExternInvocation ( node , context ,
273
273
context . GetTypeSymbol ( SpecialType . System_Object ) . GetMember < MethodSymbol > ( symbol . Name , context ) ,
274
274
instanceExpression ,
275
275
parameterExpressions ) ;
@@ -289,7 +289,7 @@ private static bool TryCreateCompareToInvocation(AbstractPhaseContext context, S
289
289
symbol . ContainingType != null &&
290
290
symbol . ContainingType == context . GetTypeSymbol ( typeof ( IComparable ) ) )
291
291
{
292
- createdInvocation = new BoundExternInvocation ( node ,
292
+ createdInvocation = new BoundExternInvocation ( node , context ,
293
293
new ExternSynthesizedMethodSymbol ( context , "CompareTo" , instanceExpression . ValueType ,
294
294
new [ ] { instanceExpression . ValueType } ,
295
295
context . GetTypeSymbol ( SpecialType . System_Int32 ) , false ) ,
@@ -344,15 +344,6 @@ public static BoundInvocationExpression CreateBoundInvocation(AbstractPhaseConte
344
344
if ( CompilerUdonInterface . IsUdonEvent ( symbol . Name ) &&
345
345
symbol . ContainingType == context . GetTypeSymbol ( typeof ( UdonSharpBehaviour ) ) ) // Pass through for making base calls on the U# behaviour type return noop
346
346
return new BoundUdonSharpBehaviourInvocationExpression ( node , symbol , instanceExpression , parameterExpressions ) ;
347
-
348
- var doExposureCheck = ( ! symbol . IsOperator || ( symbol . ContainingType == null || ! symbol . ContainingType . IsEnum ) ) ;
349
-
350
- if ( symbol . IsOperator && symbol is ExternBuiltinOperatorSymbol operatorSymbol &&
351
- operatorSymbol . OperatorType == BuiltinOperatorType . BitwiseNot )
352
- doExposureCheck = false ;
353
-
354
- if ( doExposureCheck && ! CompilerUdonInterface . IsExposedToUdon ( ( ( ExternMethodSymbol ) symbol ) . ExternSignature ) )
355
- throw new NotExposedException ( LocStr . CE_UdonMethodNotExposed , node , $ "{ symbol . RoslynSymbol ? . ToDisplayString ( ) ?? symbol . ToString ( ) } , sig: { ( ( ExternMethodSymbol ) symbol ) . ExternSignature } ") ;
356
347
357
348
if ( symbol . IsOperator )
358
349
{
@@ -371,7 +362,7 @@ public static BoundInvocationExpression CreateBoundInvocation(AbstractPhaseConte
371
362
BuiltinOperatorType . UnaryNegation , context . GetTypeSymbol ( SpecialType . System_Boolean ) ,
372
363
context ) ;
373
364
374
- return new BoundExternInvocation ( node , boolNotOperator , null , new BoundExpression [ ] { boundEqualsInvocation } ) ;
365
+ return new BoundExternInvocation ( node , context , boolNotOperator , null , new BoundExpression [ ] { boundEqualsInvocation } ) ;
375
366
}
376
367
377
368
if ( node is AssignmentExpressionSyntax )
@@ -383,13 +374,13 @@ public static BoundInvocationExpression CreateBoundInvocation(AbstractPhaseConte
383
374
384
375
if ( parameterExpressions . Length == 2 || symbol . Name == "op_UnaryNegation" || symbol . Name == "op_LogicalNot" )
385
376
{
386
- return new BoundBuiltinOperatorInvocationExpression ( node , symbol , parameterExpressions ) ;
377
+ return new BoundBuiltinOperatorInvocationExpression ( node , context , symbol , parameterExpressions ) ;
387
378
}
388
379
389
380
throw new NotSupportedException ( "Operator expressions must have either 1 or 2 parameters" , node . GetLocation ( ) ) ;
390
381
}
391
382
392
- return new BoundExternInvocation ( node , symbol , instanceExpression , parameterExpressions ) ;
383
+ return new BoundExternInvocation ( node , context , symbol , instanceExpression , parameterExpressions ) ;
393
384
}
394
385
395
386
if ( symbol . IsStatic )
@@ -596,8 +587,8 @@ protected void PopRecursiveValues(Value[] values, EmitContext context)
596
587
597
588
private sealed class BoundBuiltinOperatorInvocationExpression : BoundExternInvocation
598
589
{
599
- public BoundBuiltinOperatorInvocationExpression ( SyntaxNode node , MethodSymbol method , BoundExpression [ ] operandExpressions )
600
- : base ( node , method , null , operandExpressions )
590
+ public BoundBuiltinOperatorInvocationExpression ( SyntaxNode node , AbstractPhaseContext context , MethodSymbol method , BoundExpression [ ] operandExpressions )
591
+ : base ( node , context , method , null , operandExpressions )
601
592
{
602
593
}
603
594
}
@@ -642,7 +633,7 @@ private sealed class BoundGetUnityEngineComponentInvocation : BoundExternInvocat
642
633
public override TypeSymbol ValueType { get ; }
643
634
644
635
public BoundGetUnityEngineComponentInvocation ( AbstractPhaseContext context , SyntaxNode node , MethodSymbol methodSymbol , BoundExpression sourceExpression , BoundExpression [ ] parametersExpressions )
645
- : base ( node , BuildMethod ( context , methodSymbol ) , sourceExpression , GetParameterExpressions ( context , methodSymbol , parametersExpressions ) )
636
+ : base ( node , context , BuildMethod ( context , methodSymbol ) , sourceExpression , GetParameterExpressions ( context , methodSymbol , parametersExpressions ) )
646
637
{
647
638
ValueType = methodSymbol . TypeArguments [ 0 ] ;
648
639
0 commit comments