88 * You must not remove this notice, or any other, from this software.
99 **/
1010
11- /**
12- * Author: David Miller
13- **/
14-
1511using System ;
1612using System . Reflection . Emit ;
1713
@@ -22,32 +18,32 @@ public sealed class LocalBinding
2218 #region Data
2319
2420 private readonly Symbol _sym ;
25- public Symbol Symbol { get { return _sym ; } }
21+ public Symbol Symbol => _sym ;
2622
2723 public Symbol Tag { get ; set ; }
2824
2925 public Expr Init { get ; set ; }
3026
3127 private readonly String _name ;
32- public String Name { get { return _name ; } }
28+ public String Name => _name ;
29+
30+ public int Index { get ; set ; }
3331
34- public int Index { get ; set ; }
35-
3632 public LocalBuilder LocalVar { get ; set ; }
3733
3834 readonly bool _isArg ;
39- public bool IsArg { get { return _isArg ; } }
35+ public bool IsArg => _isArg ;
4036
4137 readonly bool _isByRef ;
42- public bool IsByRef { get { return _isByRef ; } }
38+ public bool IsByRef => _isByRef ;
4339
4440 readonly bool _isThis ;
45- public bool IsThis { get { return _isThis ; } }
41+ public bool IsThis => _isThis ;
4642
4743 public bool RecurMismatch { get ; set ; }
4844
4945 readonly Type _declaredType ;
50- public Type DeclaredType { get { return _declaredType ; } }
46+ public Type DeclaredType => _declaredType ;
5147
5248 bool _hasTypeCached = false ;
5349 bool _cachedHasType = false ;
@@ -87,7 +83,7 @@ public bool HasClrType
8783 if ( Init != null
8884 && Init . HasClrType
8985 && Util . IsPrimitive ( Init . ClrType )
90- && ! ( Init is MaybePrimitiveExpr ) )
86+ && Init is not MaybePrimitiveExpr )
9187 _cachedHasType = false ;
9288 else
9389 _cachedHasType = Tag != null || ( Init != null && Init . HasClrType ) ;
@@ -101,16 +97,12 @@ public Type ClrType
10197 {
10298 get
10399 {
104- if ( _cachedType == null )
105- _cachedType = Tag != null ? HostExpr . TagToType ( Tag ) : Init . ClrType ;
100+ _cachedType ??= Tag != null ? HostExpr . TagToType ( Tag ) : Init . ClrType ;
106101 return _cachedType ;
107102 }
108103 }
109104
110- public Type PrimitiveType
111- {
112- get { return Compiler . MaybePrimitiveType ( Init ) ; }
113- }
105+ public Type PrimitiveType => Compiler . MaybePrimitiveType ( Init ) ;
114106
115107 #endregion
116108 }
0 commit comments