| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/context.dart' as newContext; | 9 import 'package:analyzer/src/context/context.dart' as newContext; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 FileBasedSource source = | 1980 FileBasedSource source = |
| 1981 new FileBasedSource(FileUtilities2.createFile("/test.dart")); | 1981 new FileBasedSource(FileUtilities2.createFile("/test.dart")); |
| 1982 CompilationUnitElementImpl definingCompilationUnit = | 1982 CompilationUnitElementImpl definingCompilationUnit = |
| 1983 new CompilationUnitElementImpl("test.dart"); | 1983 new CompilationUnitElementImpl("test.dart"); |
| 1984 definingCompilationUnit.librarySource = | 1984 definingCompilationUnit.librarySource = |
| 1985 definingCompilationUnit.source = source; | 1985 definingCompilationUnit.source = source; |
| 1986 _definingLibrary = ElementFactory.library(context, "test"); | 1986 _definingLibrary = ElementFactory.library(context, "test"); |
| 1987 _definingLibrary.definingCompilationUnit = definingCompilationUnit; | 1987 _definingLibrary.definingCompilationUnit = definingCompilationUnit; |
| 1988 Library library = new Library(context, _listener, source); | 1988 Library library = new Library(context, _listener, source); |
| 1989 library.libraryElement = _definingLibrary; | 1989 library.libraryElement = _definingLibrary; |
| 1990 _visitor = new ResolverVisitor(library.libraryElement, source, | 1990 _visitor = new ResolverVisitor( |
| 1991 _typeProvider, context.typeSystem, library.errorListener, | 1991 library.libraryElement, source, _typeProvider, library.errorListener, |
| 1992 nameScope: library.libraryScope, | 1992 nameScope: library.libraryScope, |
| 1993 inheritanceManager: library.inheritanceManager); | 1993 inheritanceManager: library.inheritanceManager); |
| 1994 try { | 1994 try { |
| 1995 return _visitor.elementResolver; | 1995 return _visitor.elementResolver; |
| 1996 } catch (exception) { | 1996 } catch (exception) { |
| 1997 throw new IllegalArgumentException( | 1997 throw new IllegalArgumentException( |
| 1998 "Could not create resolver", exception); | 1998 "Could not create resolver", exception); |
| 1999 } | 1999 } |
| 2000 } | 2000 } |
| 2001 | 2001 |
| (...skipping 9377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11379 new FileBasedSource(FileUtilities2.createFile("/lib.dart")); | 11379 new FileBasedSource(FileUtilities2.createFile("/lib.dart")); |
| 11380 CompilationUnitElementImpl definingCompilationUnit = | 11380 CompilationUnitElementImpl definingCompilationUnit = |
| 11381 new CompilationUnitElementImpl("lib.dart"); | 11381 new CompilationUnitElementImpl("lib.dart"); |
| 11382 definingCompilationUnit.librarySource = | 11382 definingCompilationUnit.librarySource = |
| 11383 definingCompilationUnit.source = source; | 11383 definingCompilationUnit.source = source; |
| 11384 LibraryElementImpl definingLibrary = | 11384 LibraryElementImpl definingLibrary = |
| 11385 new LibraryElementImpl.forNode(context, null); | 11385 new LibraryElementImpl.forNode(context, null); |
| 11386 definingLibrary.definingCompilationUnit = definingCompilationUnit; | 11386 definingLibrary.definingCompilationUnit = definingCompilationUnit; |
| 11387 Library library = new Library(context, _listener, source); | 11387 Library library = new Library(context, _listener, source); |
| 11388 library.libraryElement = definingLibrary; | 11388 library.libraryElement = definingLibrary; |
| 11389 _visitor = new ResolverVisitor(library.libraryElement, source, | 11389 _visitor = new ResolverVisitor( |
| 11390 _typeProvider, context.typeSystem, library.errorListener, | 11390 library.libraryElement, source, _typeProvider, library.errorListener, |
| 11391 nameScope: library.libraryScope, | 11391 nameScope: library.libraryScope, |
| 11392 inheritanceManager: library.inheritanceManager); | 11392 inheritanceManager: library.inheritanceManager); |
| 11393 _visitor.overrideManager.enterScope(); | 11393 _visitor.overrideManager.enterScope(); |
| 11394 try { | 11394 try { |
| 11395 return _visitor.typeAnalyzer; | 11395 return _visitor.typeAnalyzer; |
| 11396 } catch (exception) { | 11396 } catch (exception) { |
| 11397 throw new IllegalArgumentException( | 11397 throw new IllegalArgumentException( |
| 11398 "Could not create analyzer", exception); | 11398 "Could not create analyzer", exception); |
| 11399 } | 11399 } |
| 11400 } | 11400 } |
| (...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14557 // check propagated type | 14557 // check propagated type |
| 14558 FunctionType propagatedType = node.propagatedType as FunctionType; | 14558 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 14559 expect(propagatedType.returnType, test.typeProvider.stringType); | 14559 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 14560 } on AnalysisException catch (e, stackTrace) { | 14560 } on AnalysisException catch (e, stackTrace) { |
| 14561 thrownException[0] = new CaughtException(e, stackTrace); | 14561 thrownException[0] = new CaughtException(e, stackTrace); |
| 14562 } | 14562 } |
| 14563 } | 14563 } |
| 14564 return null; | 14564 return null; |
| 14565 } | 14565 } |
| 14566 } | 14566 } |
| OLD | NEW |