mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
compiler: fix nil constant interface
A nil interface has no dynamic type (or: nil dynamic type). Don't try to use the static type as the dynamic type, because these are different.
This commit is contained in:
@@ -103,7 +103,7 @@ func (p *Program) AnalyseCallgraph() {
|
||||
// Find all types that are put in an interface.
|
||||
func (p *Program) AnalyseInterfaceConversions() {
|
||||
// Clear, if AnalyseTypes has been called before.
|
||||
p.typesWithoutMethods = map[string]int{"interface{}": 0, "error": 1}
|
||||
p.typesWithoutMethods = map[string]int{"nil": 0}
|
||||
p.typesWithMethods = map[string]*InterfaceType{}
|
||||
|
||||
for _, f := range p.Functions {
|
||||
|
||||
Reference in New Issue
Block a user