C# Language Specification



Download 0,75 Mb.
bet6/524
Sana06.01.2022
Hajmi0,75 Mb.
#324842
1   2   3   4   5   6   7   8   9   ...   524
Bog'liq
CSharp Language Specification

7.Expressions 151

7.1Expression classifications 151

7.1.1Values of expressions 152

7.2Static and Dynamic Binding 152

7.2.1Binding-time 153

7.2.2Dynamic binding 153

7.2.3Types of constituent expressions 153

7.3Operators 154

7.3.1Operator precedence and associativity 154

7.3.2Operator overloading 155

7.3.3Unary operator overload resolution 156

7.3.4Binary operator overload resolution 157

7.3.5Candidate user-defined operators 157

7.3.6Numeric promotions 157

7.3.6.1Unary numeric promotions 158

7.3.6.2Binary numeric promotions 158

7.3.7Lifted operators 159

7.4Member lookup 159

7.4.1Base types 161

7.5Function members 161

7.5.1Argument lists 163

7.5.1.1Corresponding parameters 164

7.5.1.2Run-time evaluation of argument lists 165

7.5.2Type inference 167

7.5.2.1The first phase 167

7.5.2.2The second phase 168

7.5.2.3Input types 168

7.5.2.4 Output types 168

7.5.2.5Dependence 168

7.5.2.6Output type inferences 168

7.5.2.7Explicit parameter type inferences 168

7.5.2.8Exact inferences 169

7.5.2.9Lower-bound inferences 169

7.5.2.10Upper-bound inferences 169

7.5.2.11Fixing 170

7.5.2.12Inferred return type 170

7.5.2.13Type inference for conversion of method groups 172

7.5.2.14Finding the best common type of a set of expressions 172

7.5.3Overload resolution 172

7.5.3.1Applicable function member 173

7.5.3.2Better function member 173

7.5.3.3Better conversion from expression 174

7.5.3.4Better conversion from type 175

7.5.3.5Better conversion target 175

7.5.3.6Overloading in generic classes 175

7.5.4Compile-time checking of dynamic overload resolution 176

7.5.5Function member invocation 176

7.5.5.1Invocations on boxed instances 177

7.6Primary expressions 178

7.6.1Literals 178

7.6.2Simple names 178

7.6.2.1Invariant meaning in blocks 180

7.6.3Parenthesized expressions 181

7.6.4Member access 181

7.6.4.1Identical simple names and type names 183

7.6.4.2Grammar ambiguities 183

7.6.5Invocation expressions 184

7.6.5.1Method invocations 184

7.6.5.2Extension method invocations 186

7.6.5.3Delegate invocations 188

7.6.6Element access 188

7.6.6.1Array access 189

7.6.6.2Indexer access 189

7.6.7This access 190

7.6.8Base access 191

7.6.9Postfix increment and decrement operators 191

7.6.10The new operator 192

7.6.10.1Object creation expressions 192

7.6.10.2Object initializers 194

7.6.10.3Collection initializers 196

7.6.10.4Array creation expressions 197

7.6.10.5Delegate creation expressions 199

7.6.10.6Anonymous object creation expressions 200

7.6.11The typeof operator 202

7.6.12The checked and unchecked operators 204

7.6.13Default value expressions 206

7.6.14Anonymous method expressions 206

7.7Unary operators 206

7.7.1Unary plus operator 207

7.7.2Unary minus operator 207

7.7.3Logical negation operator 208

7.7.4Bitwise complement operator 208

7.7.5Prefix increment and decrement operators 208

7.7.6Cast expressions 209

7.7.7Await expressions 210

7.7.7.1Awaitable expressions 210

7.7.7.2Classification of await expressions 211

7.7.7.3Runtime evaluation of await expressions 211

7.8Arithmetic operators 211

7.8.1Multiplication operator 211

7.8.2Division operator 212

7.8.3Remainder operator 213

7.8.4Addition operator 214

7.8.5Subtraction operator 216

7.9Shift operators 218

7.10Relational and type-testing operators 219

7.10.1Integer comparison operators 220

7.10.2Floating-point comparison operators 220

7.10.3Decimal comparison operators 221

7.10.4Boolean equality operators 221

7.10.5Enumeration comparison operators 222

7.10.6Reference type equality operators 222

7.10.7String equality operators 223

7.10.8Delegate equality operators 224

7.10.9Equality operators and null 224

7.10.10The is operator 224

7.10.11The as operator 225

7.11Logical operators 226

7.11.1Integer logical operators 226

7.11.2Enumeration logical operators 227

7.11.3Boolean logical operators 227

7.11.4Nullable boolean logical operators 227

7.12Conditional logical operators 228

7.12.1Boolean conditional logical operators 228

7.12.2User-defined conditional logical operators 229

7.13The null coalescing operator 229

7.14Conditional operator 230

7.15Anonymous function expressions 231

7.15.1Anonymous function signatures 233

7.15.2Anonymous function bodies 233

7.15.3Overload resolution 233

7.15.4Anonymous functions and dynamic binding 234

7.15.5Outer variables 234

7.15.5.1Captured outer variables 234

7.15.5.2Instantiation of local variables 235

7.15.6Evaluation of anonymous function expressions 237

7.16Query expressions 238

7.16.1Ambiguities in query expressions 239

7.16.2Query expression translation 239

7.16.2.1Select and groupby clauses with continuations 240

7.16.2.2Explicit range variable types 240

7.16.2.3Degenerate query expressions 241

7.16.2.4From, let, where, join and orderby clauses 241

7.16.2.5Select clauses 245

7.16.2.6Groupby clauses 245

7.16.2.7Transparent identifiers 245

7.16.3The query expression pattern 247

7.17Assignment operators 248

7.17.1Simple assignment 249

7.17.2Compound assignment 251

7.17.3Event assignment 252

7.18Expression 252

7.19Constant expressions 252

7.20Boolean expressions 253




Download 0,75 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   524




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish