10BC0 Internal error: Type alias AccountTypes already exists as a class. · Issue #14028 · phpstan/phpstan · GitHub
[go: up one dir, main page]

Skip to content

Internal error: Type alias AccountTypes already exists as a class. #14028

@lukemorcom

Description

@lukemorcom

Bug report

Posting the trace here as suggested by the run output:

     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Type/UsefulTypeAliasReso  
     lver.php(121)                                                                          
     #0                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Type/UsefulTypeAliasReso  
     lver.php(64):                                                                          
     PHPStan\Type\UsefulTypeAliasResolver->resolveGlobalTypeAlias('AccountTypes',           
     Object(PHPStan\Analyser\NameScope))                                                    
     #1                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/TypeNodeResolver.  
     php(364): PHPStan\Type\UsefulTypeAliasResolver->resolveTypeAlias('AccountTypes',       
     Object(PHPStan\Analyser\NameScope))                                                    
     #2                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/TypeNodeResolver.  
     php(157):                                                                              
     PHPStan\PhpDoc\TypeNodeResolver->resolveIdentifierTypeNode(Object(PHPStan\PhpDocPars   
     er\Ast\Type\IdentifierTypeNode), Object(PHPStan\Analyser\NameScope))                   
     #3                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/TypeNodeResolver.  
     php(981):                                                                              
     PHPStan\PhpDoc\TypeNodeResolver->resolve(Object(PHPStan\PhpDocParser\Ast\Type\Identi   
     fierTypeNode), Object(PHPStan\Analyser\NameScope))                                     
     #4                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/TypeNodeResolver.  
     php(488): PHPStan\PhpDoc\TypeNodeResolver->resolveMultiple(Array,                      
     Object(PHPStan\Analyser\NameScope))                                                    
     #5                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/TypeNodeResolver.  
     php(173):                                                                              
     PHPStan\PhpDoc\TypeNodeResolver->resolveGenericTypeNode(Object(PHPStan\PhpDocParser\   
     Ast\Type\GenericTypeNode), Object(PHPStan\Analyser\NameScope))                         
     #6                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocNodeResolve  
     r.php(180):                                                                            
     PHPStan\PhpDoc\TypeNodeResolver->resolve(Object(PHPStan\PhpDocParser\Ast\Type\Generi   
     cTypeNode), Object(PHPStan\Analyser\NameScope))                                        
     #7                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/ResolvedPhpDocBlo  
     ck.php(430):                                                                           
     PHPStan\PhpDoc\PhpDocNodeResolver->resolveExtendsTags(Object(PHPStan\PhpDocParser\As   
     t\PhpDoc\PhpDocNode), Object(PHPStan\Analyser\NameScope))                              
     #8                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(1540): PHPStan\PhpDoc\ResolvedPhpDocBlock->getExtendsTags()                     
     #9                                                                                     
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(1528): PHPStan\Reflection\ClassReflection->getExtendsTags()                     
     #10                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(226): PHPStan\Reflection\ClassReflection->getFirstExtendsTag()                  
     #11                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(951): PHPStan\Reflection\ClassReflection->getParentClass()                      
     #12                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(911): PHPStan\Reflection\ClassReflection->getImmediateInterfaces()              
     #13                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(1574): PHPStan\Reflection\ClassReflection->getInterfaces()                      
     #14                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(1599): PHPStan\Reflection\ClassReflection->getAncestors()                       
     #15                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/Php/PhpClassR  
     eflectionExtension.php(392):                                                           
     PHPStan\Reflection\ClassReflection->getAncestorWithClassName('Illuminate\\Supp...')    
     #16                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/Php/PhpClassR  
     eflectionExtension.php(366):                                                           
     PHPStan\Reflection\Php\PhpClassReflectionExtension->createMethod(Object(PHPStan\Refl   
     ection\ClassReflection),                                                               
     Object(PHPStan\BetterReflection\Reflection\Adapter\ReflectionMethod), false)           
     #17                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(545):                                                                           
     PHPStan\Reflection\Php\PhpClassReflectionExtension->getNativeMethod(Object(PHPStan\R   
     eflection\ClassReflection), '__construct')                                             
     #18                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflecti  
     on.php(557): PHPStan\Reflection\ClassReflection->getNativeMethod('__construct')        
     #19                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.p  
     hp(3234): PHPStan\Reflection\ClassReflection->getConstructor()                         
     #20                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.p  
     hp(952):                                                                               
     PHPStan\Analyser\MutatingScope->exactInstantiation(Object(PhpParser\Node\Expr\New_),   
     Object(PhpParser\Node\Name\FullyQualified))                                            
     #21                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.p  
     hp(663): PHPStan\Analyser\MutatingScope->resolveType('new \\App\\Collec...',           
     Object(PhpParser\Node\Expr\New_))                                                      
     #22                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.p  
     hp(833): PHPStan\Analyser\MutatingScope->getType(Object(PhpParser\Node\Expr\New_))     
     #23                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.p  
     hp(663): PHPStan\Analyser\MutatingScope->resolveType('$accountTypeCol...',             
     Object(PhpParser\Node\Expr\Assign))                                                    
     #24                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(2031):                                                                          
     PHPStan\Analyser\MutatingScope->getType(Object(PhpParser\Node\Expr\Assign))            
     #25                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(818):                                                                           
     PHPStan\Analyser\NodeScopeResolver->findEarlyTerminatingExpr(Object(PhpParser\Node\E   
     xpr\Assign), Object(PHPStan\Analyser\MutatingScope))                                   
     #26                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(515):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Expre   
     ssion), Object(PHPStan\Analyser\MutatingScope),                                        
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #27                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(493):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternalWithoutFlushingPendingFi   
     bers(Object(PhpParser\Node\Stmt\ClassMethod), Array,                                   
     Object(PHPStan\Analyser\MutatingScope),                                                
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #28                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(714):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternal(Object(PhpParser\Node\S   
     tmt\ClassMethod), Array, Object(PHPStan\Analyser\MutatingScope),                       
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #29                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(515):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Class   
     Method), Object(PHPStan\Analyser\MutatingScope),                                       
     Object(PHPStan\Analyser\ExpressionResultStorage),                                      
     Object(PHPStan\Node\ClassStatementsGatherer),                                          
     Object(PHPStan\Analyser\StatementContext))                                             
     #30                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(493):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternalWithoutFlushingPendingFi   
     bers(Object(PhpParser\Node\Stmt\Class_), Array,                                        
     Object(PHPStan\Analyser\MutatingScope),                                                
     Object(PHPStan\Analyser\ExpressionResultStorage),                                      
     Object(PHPStan\Node\ClassStatementsGatherer),                                          
     Object(PHPStan\Analyser\StatementContext))                                             
     #31                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(892):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternal(Object(PhpParser\Node\S   
     tmt\Class_), Array, Object(PHPStan\Analyser\MutatingScope),                            
     Object(PHPStan\Analyser\ExpressionResultStorage),                                      
     Object(PHPStan\Node\ClassStatementsGatherer),                                          
     Object(PHPStan\Analyser\StatementContext))                                             
     #32                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(515):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Class   
     _), Object(PHPStan\Analyser\MutatingScope),                                            
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #33                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(493):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternalWithoutFlushingPendingFi   
     bers(Object(PhpParser\Node\Stmt\Namespace_), Array,                                    
     Object(PHPStan\Analyser\MutatingScope),                                                
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #34                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(845):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNodesInternal(Object(PhpParser\Node\S   
     tmt\Namespace_), Array, Object(PHPStan\Analyser\MutatingScope),                        
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #35                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolv  
     er.php(437):                                                                           
     PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Names   
     pace_), Object(PHPStan\Analyser\MutatingScope),                                        
     Object(PHPStan\Analyser\ExpressionResultStorage), Object(Closure),                     
     Object(PHPStan\Analyser\StatementContext))                                             
     #36                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.ph  
     p(214): PHPStan\Analyser\NodeScopeResolver->processNodes(Array,                        
     Object(PHPStan\Analyser\MutatingScope), Object(Closure))                               
     #37                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.ph  
     p(149): PHPStan\Analyser\FileAnalyser->analyseFile('/var/www/html/a...', Array,        
     Object(PHPStan\Rules\LazyRegistry), Object(PHPStan\Collectors\Registry), NULL)         
     #38                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/s  
     rc/EventEmitterTrait.php(111):                                                         
     PHPStan\Command\WorkerCommand::PHPStan\Command\{closure}(Array)                        
     #39                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/clue/ndjson-react/src  
     /Decoder.php(117): _PHPStan_ef7e5b90a\Evenement\EventEmitter->emit('data', Array)      
     #40                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/s  
     rc/EventEmitterTrait.php(111):                                                         
     _PHPStan_ef7e5b90a\Clue\React\NDJson\Decoder->handleData(Array)                        
     #41                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/Util  
     .php(62): _PHPStan_ef7e5b90a\Evenement\EventEmitter->emit('data', Array)               
     #42                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/s  
     rc/EventEmitterTrait.php(111):                                                         
     _PHPStan_ef7e5b90a\React\Stream\Util::_PHPStan_ef7e5b90a\React\Stream\{closure}('{"ac  
     tion":"anal...')                                                                       
     #43                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/Dupl  
     exResourceStream.php(168): _PHPStan_ef7e5b90a\Evenement\EventEmitter->emit('data',     
     Array)                                                                                 
     #44                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/  
     StreamSelectLoop.php(201):                                                             
     _PHPStan_ef7e5b90a\React\Stream\DuplexResourceStream->handleData(Resource id #9232)    
     #45                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/  
     StreamSelectLoop.php(173):                                                             
     _PHPStan_ef7e5b90a\React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)       
     #46                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.ph  
     p(105): _PHPStan_ef7e5b90a\React\EventLoop\StreamSelectLoop->run()                     
     #47                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Comma  
     nd/Command.php(259):                                                                   
     PHPStan\Command\WorkerCommand->execute(Object(_PHPStan_ef7e5b90a\Symfony\Component\C   
     onsole\Input\ArgvInput),                                                               
     Object(_PHPStan_ef7e5b90a\Symfony\Component\Console\Output\ConsoleOutput))             
     #48                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Appli  
     cation.php(868):                                                                       
     _PHPStan_ef7e5b90a\Symfony\Component\Console\Command\Command->run(Object(_PHPStan_ef   
     7e5b90a\Symfony\Component\Console\Input\ArgvInput),                                    
     Object(_PHPStan_ef7e5b90a\Symfony\Component\Console\Output\ConsoleOutput))             
     #49                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Appli  
     cation.php(261):                                                                       
     _PHPStan_ef7e5b90a\Symfony\Component\Console\Application->doRunCommand(Object(PHPSta   
     n\Command\WorkerCommand),                                                              
     Object(_PHPStan_ef7e5b90a\Symfony\Component\Console\Input\ArgvInput),                  
     Object(_PHPStan_ef7e5b90a\Symfony\Component\Console\Output\ConsoleOutput))             
     #50                                                                                    
     phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Appli  
     cation.php(157):                                                                       
     _PHPStan_ef7e5b90a\Symfony\Component\Console\Application->doRun(Object(_PHPStan_ef7e   
     5b90a\Symfony\Component\Console\Input\ArgvInput),                                      
     Object(_PHPStan_ef7e5b90a\Symfony\Component\Console\Output\ConsoleOutput))             
     #51 phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(103):         
     _PHPStan_ef7e5b90a\Symfony\Component\Console\Application->run()                        
     #52 phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(104):         
     _PHPStan_ef7e5b90a\{closure}()                                                         
     #53 /var/www/html/vendor/phpstan/phpstan/phpstan(8): require('phar:///var/www...')     
     #54 /var/www/html/vendor/bin/phpstan(119): include('/var/www/html/v...')               
     #55 {main}                                                                             
 -- -------------

Code snippet that reproduces the problem

No response

Expected output

It analyses and doesn't tell me to submit a bug report

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0