Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(bug): allow nullable parameterized types
Browse files Browse the repository at this point in the history
fixes #56
  • Loading branch information
alexeagle committed Aug 31, 2015
1 parent 3281c13 commit ae4a79f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ private void visitUnionType(UnionType ut) {
public boolean apply(JSType input) {
// Skip - TypeScript does not have explicit null or optional types.
// Optional types must be handled at the declaration name (`foo?` syntax).
return !input.isNullable() && !input.isVoidType();
return !input.isNullType() && !input.isVoidType();
}
});
if (alts.size() == 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/google/javascript/cl2dts/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declare namespace ಠ_ಠ.cl2dts_internal.types {
var d : Object ;
var e : any [] ;
class Foo < T > {
genericMethod < V , W > (t : T , v : V ) : any ;
genericMethod < V , W > (t : T , v ? : V ) : any ;
get ( ) : T ;
set (t : T ) : void ;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/google/javascript/cl2dts/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ types.Foo.prototype.set = function(t) { };

/**
* @param {T} t
* @param {V} v
* @param {V=} v
* @template V
* @template W
*/
Expand Down

0 comments on commit ae4a79f

Please sign in to comment.