Git Product home page Git Product logo

typepx's People

Contributors

kirkmunro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

typepx's Issues

array.ps1

https://github.com/KirkMunro/TypePx/blob/master/typedata/array.ps1#L136

if ($results.Count -eq 1) {
    ,$results
} else {
    $results
}

Shouldn't this be $results.Count -le 1 ?

#### Repro

PS> function return0    { $o = new-object System.Collections.ArrayList; if($o.Count -eq 1) {return ,$o} else {return $o} }
PS> function return0alt { $o = new-object System.Collections.ArrayList; if($o.Count -le 1) {return ,$o} else {return $o} }
PS> function return1    { $o = new-object System.Collections.ArrayList; [Void]$o.Add('a'); if($o.Count -eq 1) {return ,$o} else {return $o} }
PS> function return2    { $o = new-object System.Collections.ArrayList; [Void]$o.Add('a'); [Void]$o.Add('b'); if($o.Count -eq 1) {return ,$o} else {return $o} }

#### Results

PS> $result = return0; $result.GetType(); $result.Count;
You cannot call a method on a null-valued expression.
At line:1 char:20
+ $result = return0; $result.GetType(); $result.Count;
+                    ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

0

PS> $result = return0alt; $result.GetType().ToString(); $result.Count;
System.Collections.ArrayList
0

PS> $result = return1; $result.GetType(); $result.Count;
System.Collections.ArrayList
1

PS> $result = return2; $result.GetType().ToString(); $result.Count;
System.Object[]
2

Get-TypeAccelerator -Name switch exception

On my Windows 7 desktop running PowerShell 3 I encounter an exception when attempting to run the command> Get-TypeAccelerator -Name switch

The other variations of this function (Examples 1,3,4) run fine. When I first encountered this problem I had version 2.0.0.14 of TypePx, an update to 2.0.0.16 did not change the exception behavior.

Get-TypeAccelerator : Exception calling "LikeAny" with "1" argument(s): "Exception calling "where" with "1" argument(s): "Exception calling "LikeAny" with "1"
argument(s): "Property 'Count' cannot be found on this object. Make sure that it exists."""
At line:1 char:1

  • Get-TypeAccelerator -Name switch
  • - CategoryInfo          : NotSpecified: (:) [Get-TypeAccelerator], MethodInvocationException
    - FullyQualifiedErrorId : ScriptMethodRuntimeException,Get-TypeAccelerator
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.