-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generic types in methods and
as
cast (dart-archive/…
…code_builder#70) * Add support for generic types and as cast * Update CHANGELOG and pubspec. * Rename name: to constructor:
- Loading branch information
1 parent
ae77038
commit 2cd87a9
Showing
11 changed files
with
231 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
part of code_builder.src.builders.expression; | ||
|
||
class _AsCast extends TopLevelMixin with AbstractExpressionMixin { | ||
final ExpressionBuilder _target; | ||
final TypeBuilder _type; | ||
|
||
_AsCast(this._target, this._type); | ||
|
||
@override | ||
AstNode buildAst([Scope scope]) => buildExpression(scope); | ||
|
||
@override | ||
Expression buildExpression([Scope scope]) { | ||
return astFactory.asExpression( | ||
_target.buildExpression(scope), | ||
$as, | ||
_type.buildType(scope), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: code_builder | ||
version: 1.0.0-beta+2 | ||
version: 1.0.0-beta+3 | ||
description: A fluent API for generating Dart code | ||
author: Dart Team <[email protected]> | ||
homepage: https://github.com/dart-lang/code_builder | ||
|
Oops, something went wrong.