diff --git a/scanner/scanner.go b/scanner/scanner.go index 70c02f0..5fd4c23 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -243,6 +243,10 @@ func scanType(typ types.Type) (t Type) { case *types.Map: key := scanType(u.Key()) val := scanType(u.Elem()) + if val == nil { + report.Warn("ignoring map with value type %s", typ.String()) + return nil + } t = NewMap(key, val) default: report.Warn("ignoring type %s", typ.String()) diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index b2423ca..b18af67 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -93,6 +93,11 @@ func TestScanType(t *testing.T) { types.NewInterface(nil, nil), nil, }, + { + "map interface", + types.NewMap(types.Typ[types.String], &types.Interface{}), + nil, + }, } for _, c := range cases {