| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library summary_resynthesizer; | 5 library summary_resynthesizer; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 */ | 294 */ |
| 295 bool _hasLibrarySummary(String uri) { | 295 bool _hasLibrarySummary(String uri) { |
| 296 if (parent != null && parent._hasLibrarySummary(uri)) { | 296 if (parent != null && parent._hasLibrarySummary(uri)) { |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 return hasLibrarySummary(uri); | 299 return hasLibrarySummary(uri); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 /** | 303 /** |
| 304 * Builder of [Expression]s from [UnlinkedConst]s. | 304 * Builder of [Expression]s from [UnlinkedExpr]s. |
| 305 */ | 305 */ |
| 306 class _ConstExprBuilder { | 306 class _ConstExprBuilder { |
| 307 final _UnitResynthesizer resynthesizer; | 307 final _UnitResynthesizer resynthesizer; |
| 308 final ElementImpl context; | 308 final ElementImpl context; |
| 309 final UnlinkedConst uc; | 309 final UnlinkedExpr uc; |
| 310 | 310 |
| 311 int intPtr = 0; | 311 int intPtr = 0; |
| 312 int doublePtr = 0; | 312 int doublePtr = 0; |
| 313 int stringPtr = 0; | 313 int stringPtr = 0; |
| 314 int refPtr = 0; | 314 int refPtr = 0; |
| 315 final List<Expression> stack = <Expression>[]; | 315 final List<Expression> stack = <Expression>[]; |
| 316 | 316 |
| 317 _ConstExprBuilder(this.resynthesizer, this.context, this.uc); | 317 _ConstExprBuilder(this.resynthesizer, this.context, this.uc); |
| 318 | 318 |
| 319 /** | 319 /** |
| 320 * Return the [ConstructorElement] enclosing [context]. | 320 * Return the [ConstructorElement] enclosing [context]. |
| 321 */ | 321 */ |
| 322 ConstructorElement get _enclosingConstructor { | 322 ConstructorElement get _enclosingConstructor { |
| 323 for (Element e = context; e != null; e = e.enclosingElement) { | 323 for (Element e = context; e != null; e = e.enclosingElement) { |
| 324 if (e is ConstructorElement) { | 324 if (e is ConstructorElement) { |
| 325 return e; | 325 return e; |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 throw new StateError( | 328 throw new StateError( |
| 329 'Unable to find the enclosing constructor of $context'); | 329 'Unable to find the enclosing constructor of $context'); |
| 330 } | 330 } |
| 331 | 331 |
| 332 Expression build() { | 332 Expression build() { |
| 333 if (!uc.isValidConst) { | 333 if (!uc.isValidConst) { |
| 334 return AstFactory.identifier3(r'$$invalidConstExpr$$'); | 334 return AstFactory.identifier3(r'$$invalidConstExpr$$'); |
| 335 } | 335 } |
| 336 for (UnlinkedConstOperation operation in uc.operations) { | 336 for (UnlinkedExprOperation operation in uc.operations) { |
| 337 switch (operation) { | 337 switch (operation) { |
| 338 case UnlinkedConstOperation.pushNull: | 338 case UnlinkedExprOperation.pushNull: |
| 339 _push(AstFactory.nullLiteral()); | 339 _push(AstFactory.nullLiteral()); |
| 340 break; | 340 break; |
| 341 // bool | 341 // bool |
| 342 case UnlinkedConstOperation.pushFalse: | 342 case UnlinkedExprOperation.pushFalse: |
| 343 _push(AstFactory.booleanLiteral(false)); | 343 _push(AstFactory.booleanLiteral(false)); |
| 344 break; | 344 break; |
| 345 case UnlinkedConstOperation.pushTrue: | 345 case UnlinkedExprOperation.pushTrue: |
| 346 _push(AstFactory.booleanLiteral(true)); | 346 _push(AstFactory.booleanLiteral(true)); |
| 347 break; | 347 break; |
| 348 // literals | 348 // literals |
| 349 case UnlinkedConstOperation.pushInt: | 349 case UnlinkedExprOperation.pushInt: |
| 350 int value = uc.ints[intPtr++]; | 350 int value = uc.ints[intPtr++]; |
| 351 _push(AstFactory.integer(value)); | 351 _push(AstFactory.integer(value)); |
| 352 break; | 352 break; |
| 353 case UnlinkedConstOperation.pushLongInt: | 353 case UnlinkedExprOperation.pushLongInt: |
| 354 int value = 0; | 354 int value = 0; |
| 355 int count = uc.ints[intPtr++]; | 355 int count = uc.ints[intPtr++]; |
| 356 for (int i = 0; i < count; i++) { | 356 for (int i = 0; i < count; i++) { |
| 357 int next = uc.ints[intPtr++]; | 357 int next = uc.ints[intPtr++]; |
| 358 value = value << 32 | next; | 358 value = value << 32 | next; |
| 359 } | 359 } |
| 360 _push(AstFactory.integer(value)); | 360 _push(AstFactory.integer(value)); |
| 361 break; | 361 break; |
| 362 case UnlinkedConstOperation.pushDouble: | 362 case UnlinkedExprOperation.pushDouble: |
| 363 double value = uc.doubles[doublePtr++]; | 363 double value = uc.doubles[doublePtr++]; |
| 364 _push(AstFactory.doubleLiteral(value)); | 364 _push(AstFactory.doubleLiteral(value)); |
| 365 break; | 365 break; |
| 366 case UnlinkedConstOperation.makeSymbol: | 366 case UnlinkedExprOperation.makeSymbol: |
| 367 String component = uc.strings[stringPtr++]; | 367 String component = uc.strings[stringPtr++]; |
| 368 _push(AstFactory.symbolLiteral([component])); | 368 _push(AstFactory.symbolLiteral([component])); |
| 369 break; | 369 break; |
| 370 // String | 370 // String |
| 371 case UnlinkedConstOperation.pushString: | 371 case UnlinkedExprOperation.pushString: |
| 372 String value = uc.strings[stringPtr++]; | 372 String value = uc.strings[stringPtr++]; |
| 373 _push(AstFactory.string2(value)); | 373 _push(AstFactory.string2(value)); |
| 374 break; | 374 break; |
| 375 case UnlinkedConstOperation.concatenate: | 375 case UnlinkedExprOperation.concatenate: |
| 376 int count = uc.ints[intPtr++]; | 376 int count = uc.ints[intPtr++]; |
| 377 List<InterpolationElement> elements = <InterpolationElement>[]; | 377 List<InterpolationElement> elements = <InterpolationElement>[]; |
| 378 for (int i = 0; i < count; i++) { | 378 for (int i = 0; i < count; i++) { |
| 379 Expression expr = _pop(); | 379 Expression expr = _pop(); |
| 380 InterpolationElement element = _newInterpolationElement(expr); | 380 InterpolationElement element = _newInterpolationElement(expr); |
| 381 elements.insert(0, element); | 381 elements.insert(0, element); |
| 382 } | 382 } |
| 383 _push(AstFactory.string(elements)); | 383 _push(AstFactory.string(elements)); |
| 384 break; | 384 break; |
| 385 // binary | 385 // binary |
| 386 case UnlinkedConstOperation.equal: | 386 case UnlinkedExprOperation.equal: |
| 387 _pushBinary(TokenType.EQ_EQ); | 387 _pushBinary(TokenType.EQ_EQ); |
| 388 break; | 388 break; |
| 389 case UnlinkedConstOperation.notEqual: | 389 case UnlinkedExprOperation.notEqual: |
| 390 _pushBinary(TokenType.BANG_EQ); | 390 _pushBinary(TokenType.BANG_EQ); |
| 391 break; | 391 break; |
| 392 case UnlinkedConstOperation.and: | 392 case UnlinkedExprOperation.and: |
| 393 _pushBinary(TokenType.AMPERSAND_AMPERSAND); | 393 _pushBinary(TokenType.AMPERSAND_AMPERSAND); |
| 394 break; | 394 break; |
| 395 case UnlinkedConstOperation.or: | 395 case UnlinkedExprOperation.or: |
| 396 _pushBinary(TokenType.BAR_BAR); | 396 _pushBinary(TokenType.BAR_BAR); |
| 397 break; | 397 break; |
| 398 case UnlinkedConstOperation.bitXor: | 398 case UnlinkedExprOperation.bitXor: |
| 399 _pushBinary(TokenType.CARET); | 399 _pushBinary(TokenType.CARET); |
| 400 break; | 400 break; |
| 401 case UnlinkedConstOperation.bitAnd: | 401 case UnlinkedExprOperation.bitAnd: |
| 402 _pushBinary(TokenType.AMPERSAND); | 402 _pushBinary(TokenType.AMPERSAND); |
| 403 break; | 403 break; |
| 404 case UnlinkedConstOperation.bitOr: | 404 case UnlinkedExprOperation.bitOr: |
| 405 _pushBinary(TokenType.BAR); | 405 _pushBinary(TokenType.BAR); |
| 406 break; | 406 break; |
| 407 case UnlinkedConstOperation.bitShiftLeft: | 407 case UnlinkedExprOperation.bitShiftLeft: |
| 408 _pushBinary(TokenType.LT_LT); | 408 _pushBinary(TokenType.LT_LT); |
| 409 break; | 409 break; |
| 410 case UnlinkedConstOperation.bitShiftRight: | 410 case UnlinkedExprOperation.bitShiftRight: |
| 411 _pushBinary(TokenType.GT_GT); | 411 _pushBinary(TokenType.GT_GT); |
| 412 break; | 412 break; |
| 413 case UnlinkedConstOperation.add: | 413 case UnlinkedExprOperation.add: |
| 414 _pushBinary(TokenType.PLUS); | 414 _pushBinary(TokenType.PLUS); |
| 415 break; | 415 break; |
| 416 case UnlinkedConstOperation.subtract: | 416 case UnlinkedExprOperation.subtract: |
| 417 _pushBinary(TokenType.MINUS); | 417 _pushBinary(TokenType.MINUS); |
| 418 break; | 418 break; |
| 419 case UnlinkedConstOperation.multiply: | 419 case UnlinkedExprOperation.multiply: |
| 420 _pushBinary(TokenType.STAR); | 420 _pushBinary(TokenType.STAR); |
| 421 break; | 421 break; |
| 422 case UnlinkedConstOperation.divide: | 422 case UnlinkedExprOperation.divide: |
| 423 _pushBinary(TokenType.SLASH); | 423 _pushBinary(TokenType.SLASH); |
| 424 break; | 424 break; |
| 425 case UnlinkedConstOperation.floorDivide: | 425 case UnlinkedExprOperation.floorDivide: |
| 426 _pushBinary(TokenType.TILDE_SLASH); | 426 _pushBinary(TokenType.TILDE_SLASH); |
| 427 break; | 427 break; |
| 428 case UnlinkedConstOperation.modulo: | 428 case UnlinkedExprOperation.modulo: |
| 429 _pushBinary(TokenType.PERCENT); | 429 _pushBinary(TokenType.PERCENT); |
| 430 break; | 430 break; |
| 431 case UnlinkedConstOperation.greater: | 431 case UnlinkedExprOperation.greater: |
| 432 _pushBinary(TokenType.GT); | 432 _pushBinary(TokenType.GT); |
| 433 break; | 433 break; |
| 434 case UnlinkedConstOperation.greaterEqual: | 434 case UnlinkedExprOperation.greaterEqual: |
| 435 _pushBinary(TokenType.GT_EQ); | 435 _pushBinary(TokenType.GT_EQ); |
| 436 break; | 436 break; |
| 437 case UnlinkedConstOperation.less: | 437 case UnlinkedExprOperation.less: |
| 438 _pushBinary(TokenType.LT); | 438 _pushBinary(TokenType.LT); |
| 439 break; | 439 break; |
| 440 case UnlinkedConstOperation.lessEqual: | 440 case UnlinkedExprOperation.lessEqual: |
| 441 _pushBinary(TokenType.LT_EQ); | 441 _pushBinary(TokenType.LT_EQ); |
| 442 break; | 442 break; |
| 443 // prefix | 443 // prefix |
| 444 case UnlinkedConstOperation.complement: | 444 case UnlinkedExprOperation.complement: |
| 445 _pushPrefix(TokenType.TILDE); | 445 _pushPrefix(TokenType.TILDE); |
| 446 break; | 446 break; |
| 447 case UnlinkedConstOperation.negate: | 447 case UnlinkedExprOperation.negate: |
| 448 _pushPrefix(TokenType.MINUS); | 448 _pushPrefix(TokenType.MINUS); |
| 449 break; | 449 break; |
| 450 case UnlinkedConstOperation.not: | 450 case UnlinkedExprOperation.not: |
| 451 _pushPrefix(TokenType.BANG); | 451 _pushPrefix(TokenType.BANG); |
| 452 break; | 452 break; |
| 453 // conditional | 453 // conditional |
| 454 case UnlinkedConstOperation.conditional: | 454 case UnlinkedExprOperation.conditional: |
| 455 Expression elseExpr = _pop(); | 455 Expression elseExpr = _pop(); |
| 456 Expression thenExpr = _pop(); | 456 Expression thenExpr = _pop(); |
| 457 Expression condition = _pop(); | 457 Expression condition = _pop(); |
| 458 _push( | 458 _push( |
| 459 AstFactory.conditionalExpression(condition, thenExpr, elseExpr)); | 459 AstFactory.conditionalExpression(condition, thenExpr, elseExpr)); |
| 460 break; | 460 break; |
| 461 // invokeMethodRef | 461 // invokeMethodRef |
| 462 case UnlinkedConstOperation.invokeMethodRef: | 462 case UnlinkedExprOperation.invokeMethodRef: |
| 463 _pushInvokeMethodRef(); | 463 _pushInvokeMethodRef(); |
| 464 break; | 464 break; |
| 465 // containers | 465 // containers |
| 466 case UnlinkedConstOperation.makeUntypedList: | 466 case UnlinkedExprOperation.makeUntypedList: |
| 467 _pushList(null); | 467 _pushList(null); |
| 468 break; | 468 break; |
| 469 case UnlinkedConstOperation.makeTypedList: | 469 case UnlinkedExprOperation.makeTypedList: |
| 470 TypeName itemType = _newTypeName(); | 470 TypeName itemType = _newTypeName(); |
| 471 _pushList(AstFactory.typeArgumentList(<TypeName>[itemType])); | 471 _pushList(AstFactory.typeArgumentList(<TypeName>[itemType])); |
| 472 break; | 472 break; |
| 473 case UnlinkedConstOperation.makeUntypedMap: | 473 case UnlinkedExprOperation.makeUntypedMap: |
| 474 _pushMap(null); | 474 _pushMap(null); |
| 475 break; | 475 break; |
| 476 case UnlinkedConstOperation.makeTypedMap: | 476 case UnlinkedExprOperation.makeTypedMap: |
| 477 TypeName keyType = _newTypeName(); | 477 TypeName keyType = _newTypeName(); |
| 478 TypeName valueType = _newTypeName(); | 478 TypeName valueType = _newTypeName(); |
| 479 _pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType])); | 479 _pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType])); |
| 480 break; | 480 break; |
| 481 case UnlinkedConstOperation.pushReference: | 481 case UnlinkedExprOperation.pushReference: |
| 482 _pushReference(); | 482 _pushReference(); |
| 483 break; | 483 break; |
| 484 case UnlinkedConstOperation.extractProperty: | 484 case UnlinkedExprOperation.extractProperty: |
| 485 _pushExtractProperty(); | 485 _pushExtractProperty(); |
| 486 break; | 486 break; |
| 487 case UnlinkedConstOperation.invokeConstructor: | 487 case UnlinkedExprOperation.invokeConstructor: |
| 488 _pushInstanceCreation(); | 488 _pushInstanceCreation(); |
| 489 break; | 489 break; |
| 490 case UnlinkedConstOperation.pushParameter: | 490 case UnlinkedExprOperation.pushParameter: |
| 491 String name = uc.strings[stringPtr++]; | 491 String name = uc.strings[stringPtr++]; |
| 492 SimpleIdentifier identifier = AstFactory.identifier3(name); | 492 SimpleIdentifier identifier = AstFactory.identifier3(name); |
| 493 identifier.staticElement = _enclosingConstructor.parameters | 493 identifier.staticElement = _enclosingConstructor.parameters |
| 494 .firstWhere((parameter) => parameter.name == name, | 494 .firstWhere((parameter) => parameter.name == name, |
| 495 orElse: () => throw new StateError( | 495 orElse: () => throw new StateError( |
| 496 'Unable to resolve constructor parameter: $name')); | 496 'Unable to resolve constructor parameter: $name')); |
| 497 _push(identifier); | 497 _push(identifier); |
| 498 break; | 498 break; |
| 499 case UnlinkedConstOperation.assignToRef: | 499 case UnlinkedExprOperation.assignToRef: |
| 500 case UnlinkedConstOperation.assignToProperty: | 500 case UnlinkedExprOperation.assignToProperty: |
| 501 case UnlinkedConstOperation.assignToIndex: | 501 case UnlinkedExprOperation.assignToIndex: |
| 502 case UnlinkedConstOperation.extractIndex: | 502 case UnlinkedExprOperation.extractIndex: |
| 503 case UnlinkedConstOperation.invokeMethod: | 503 case UnlinkedExprOperation.invokeMethod: |
| 504 case UnlinkedConstOperation.cascadeSectionBegin: | 504 case UnlinkedExprOperation.cascadeSectionBegin: |
| 505 case UnlinkedConstOperation.cascadeSectionEnd: | 505 case UnlinkedExprOperation.cascadeSectionEnd: |
| 506 case UnlinkedConstOperation.typeCast: | 506 case UnlinkedExprOperation.typeCast: |
| 507 case UnlinkedConstOperation.typeCheck: | 507 case UnlinkedExprOperation.typeCheck: |
| 508 case UnlinkedConstOperation.throwException: | 508 case UnlinkedExprOperation.throwException: |
| 509 case UnlinkedConstOperation.pushLocalFunctionReference: | 509 case UnlinkedExprOperation.pushLocalFunctionReference: |
| 510 throw new UnimplementedError( | 510 throw new UnimplementedError( |
| 511 'Unexpected $operation in a constant expression.'); | 511 'Unexpected $operation in a constant expression.'); |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 return stack.single; | 514 return stack.single; |
| 515 } | 515 } |
| 516 | 516 |
| 517 List<Expression> _buildArguments() { | 517 List<Expression> _buildArguments() { |
| 518 List<Expression> arguments; | 518 List<Expression> arguments; |
| 519 { | 519 { |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 return typeArguments; | 1363 return typeArguments; |
| 1364 } | 1364 } |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 class _ResynthesizerContext implements ResynthesizerContext { | 1367 class _ResynthesizerContext implements ResynthesizerContext { |
| 1368 final _UnitResynthesizer _unitResynthesizer; | 1368 final _UnitResynthesizer _unitResynthesizer; |
| 1369 | 1369 |
| 1370 _ResynthesizerContext(this._unitResynthesizer); | 1370 _ResynthesizerContext(this._unitResynthesizer); |
| 1371 | 1371 |
| 1372 @override | 1372 @override |
| 1373 ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) { | 1373 ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) { |
| 1374 return _unitResynthesizer.buildAnnotation(context, uc); | 1374 return _unitResynthesizer.buildAnnotation(context, uc); |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 @override | 1377 @override |
| 1378 Expression buildExpression(ElementImpl context, UnlinkedConst uc) { | 1378 Expression buildExpression(ElementImpl context, UnlinkedExpr uc) { |
| 1379 return _unitResynthesizer._buildConstExpression(context, uc); | 1379 return _unitResynthesizer._buildConstExpression(context, uc); |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 @override | 1382 @override |
| 1383 UnitExplicitTopLevelAccessors buildTopLevelAccessors() { | 1383 UnitExplicitTopLevelAccessors buildTopLevelAccessors() { |
| 1384 return _unitResynthesizer.buildUnitExplicitTopLevelAccessors(); | 1384 return _unitResynthesizer.buildUnitExplicitTopLevelAccessors(); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 @override | 1387 @override |
| 1388 UnitExplicitTopLevelVariables buildTopLevelVariables() { | 1388 UnitExplicitTopLevelVariables buildTopLevelVariables() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 numUnlinkedReferences = unlinkedUnit.references.length; | 1500 numUnlinkedReferences = unlinkedUnit.references.length; |
| 1501 referenceInfos = new List<_ReferenceInfo>(numLinkedReferences); | 1501 referenceInfos = new List<_ReferenceInfo>(numLinkedReferences); |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 SummaryResynthesizer get summaryResynthesizer => | 1504 SummaryResynthesizer get summaryResynthesizer => |
| 1505 libraryResynthesizer.summaryResynthesizer; | 1505 libraryResynthesizer.summaryResynthesizer; |
| 1506 | 1506 |
| 1507 TypeProvider get typeProvider => summaryResynthesizer.typeProvider; | 1507 TypeProvider get typeProvider => summaryResynthesizer.typeProvider; |
| 1508 | 1508 |
| 1509 /** | 1509 /** |
| 1510 * Build [ElementAnnotationImpl] for the given [UnlinkedConst]. | 1510 * Build [ElementAnnotationImpl] for the given [UnlinkedExpr]. |
| 1511 */ | 1511 */ |
| 1512 ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedConst uc) { | 1512 ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) { |
| 1513 ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(unit); | 1513 ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(unit); |
| 1514 Expression constExpr = _buildConstExpression(context, uc); | 1514 Expression constExpr = _buildConstExpression(context, uc); |
| 1515 if (constExpr is Identifier) { | 1515 if (constExpr is Identifier) { |
| 1516 elementAnnotation.element = constExpr.staticElement; | 1516 elementAnnotation.element = constExpr.staticElement; |
| 1517 elementAnnotation.annotationAst = AstFactory.annotation(constExpr); | 1517 elementAnnotation.annotationAst = AstFactory.annotation(constExpr); |
| 1518 } else if (constExpr is InstanceCreationExpression) { | 1518 } else if (constExpr is InstanceCreationExpression) { |
| 1519 elementAnnotation.element = constExpr.staticElement; | 1519 elementAnnotation.element = constExpr.staticElement; |
| 1520 Identifier typeName = constExpr.constructorName.type.name; | 1520 Identifier typeName = constExpr.constructorName.type.name; |
| 1521 SimpleIdentifier constructorName = constExpr.constructorName.name; | 1521 SimpleIdentifier constructorName = constExpr.constructorName.name; |
| 1522 if (typeName is SimpleIdentifier && constructorName != null) { | 1522 if (typeName is SimpleIdentifier && constructorName != null) { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 break; | 1797 break; |
| 1798 } | 1798 } |
| 1799 } | 1799 } |
| 1800 result = new _ReferenceInfo(libraryResynthesizer, enclosingInfo, name, | 1800 result = new _ReferenceInfo(libraryResynthesizer, enclosingInfo, name, |
| 1801 element, type, numTypeParameters); | 1801 element, type, numTypeParameters); |
| 1802 referenceInfos[index] = result; | 1802 referenceInfos[index] = result; |
| 1803 } | 1803 } |
| 1804 return result; | 1804 return result; |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 Expression _buildConstExpression(ElementImpl context, UnlinkedConst uc) { | 1807 Expression _buildConstExpression(ElementImpl context, UnlinkedExpr uc) { |
| 1808 return new _ConstExprBuilder(this, context, uc).build(); | 1808 return new _ConstExprBuilder(this, context, uc).build(); |
| 1809 } | 1809 } |
| 1810 | 1810 |
| 1811 /** | 1811 /** |
| 1812 * Return the defining type for a [ConstructorElement] by applying | 1812 * Return the defining type for a [ConstructorElement] by applying |
| 1813 * [typeArgumentRefs] to the given linked [info]. Return [DynamicTypeImpl] | 1813 * [typeArgumentRefs] to the given linked [info]. Return [DynamicTypeImpl] |
| 1814 * if the [info] is unresolved. | 1814 * if the [info] is unresolved. |
| 1815 */ | 1815 */ |
| 1816 DartType _createConstructorDefiningType( | 1816 DartType _createConstructorDefiningType( |
| 1817 TypeParameterizedElementMixin typeParameterContext, | 1817 TypeParameterizedElementMixin typeParameterContext, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 static String _getElementIdentifier(String name, ReferenceKind kind) { | 1877 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 1878 if (kind == ReferenceKind.topLevelPropertyAccessor || | 1878 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 1879 kind == ReferenceKind.propertyAccessor) { | 1879 kind == ReferenceKind.propertyAccessor) { |
| 1880 if (!name.endsWith('=')) { | 1880 if (!name.endsWith('=')) { |
| 1881 return name + '?'; | 1881 return name + '?'; |
| 1882 } | 1882 } |
| 1883 } | 1883 } |
| 1884 return name; | 1884 return name; |
| 1885 } | 1885 } |
| 1886 } | 1886 } |
| OLD | NEW |