| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.dart.compiler.DartCompilationError; | 8 import com.google.dart.compiler.DartCompilationError; |
| 9 import com.google.dart.compiler.DartCompilerContext; | 9 import com.google.dart.compiler.DartCompilerContext; |
| 10 import com.google.dart.compiler.DartCompilerListener; | 10 import com.google.dart.compiler.DartCompilerListener; |
| 11 import com.google.dart.compiler.ErrorCode; | 11 import com.google.dart.compiler.ErrorCode; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 this.library = library; | 147 this.library = library; |
| 148 } | 148 } |
| 149 | 149 |
| 150 @Override | 150 @Override |
| 151 public Void visitClass(DartClass node) { | 151 public Void visitClass(DartClass node) { |
| 152 ClassElement element = Elements.classFromNode(node, library); | 152 ClassElement element = Elements.classFromNode(node, library); |
| 153 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); | 153 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); |
| 154 element.setType(Types.interfaceType(element, | 154 element.setType(Types.interfaceType(element, |
| 155 Elements.makeTypeVariables(parameterNo
des, element))); | 155 Elements.makeTypeVariables(parameterNo
des, element))); |
| 156 node.setSymbol(element); | 156 node.setSymbol(element); |
| 157 node.getName().setSymbol(element); |
| 157 return null; | 158 return null; |
| 158 } | 159 } |
| 159 | 160 |
| 160 @Override | 161 @Override |
| 161 public Void visitFunctionTypeAlias(DartFunctionTypeAlias node) { | 162 public Void visitFunctionTypeAlias(DartFunctionTypeAlias node) { |
| 162 FunctionAliasElement element = Elements.functionTypeAliasFromNode(node, li
brary); | 163 FunctionAliasElement element = Elements.functionTypeAliasFromNode(node, li
brary); |
| 163 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); | 164 List<DartTypeParameter> parameterNodes = node.getTypeParameters(); |
| 164 element.setType(Types.functionAliasType(element, | 165 element.setType(Types.functionAliasType(element, |
| 165 Elements.makeTypeVariables(paramet
erNodes, element))); | 166 Elements.makeTypeVariables(paramet
erNodes, element))); |
| 166 node.setSymbol(element); | 167 node.setSymbol(element); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 178 Modifiers modifiers = node.getModifiers(); | 179 Modifiers modifiers = node.getModifiers(); |
| 179 if (modifiers.isFinal()) { | 180 if (modifiers.isFinal()) { |
| 180 // final toplevel fields are implicitly compile-time constants. | 181 // final toplevel fields are implicitly compile-time constants. |
| 181 modifiers = modifiers.makeConstant(); | 182 modifiers = modifiers.makeConstant(); |
| 182 } | 183 } |
| 183 node.setSymbol(Elements.fieldFromNode(node, library, modifiers)); | 184 node.setSymbol(Elements.fieldFromNode(node, library, modifiers)); |
| 184 return null; | 185 return null; |
| 185 } | 186 } |
| 186 } | 187 } |
| 187 } | 188 } |
| OLD | NEW |