diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v
index bcceb1d039..72aa49c283 100644
--- a/vlib/v/parser/parser.v
+++ b/vlib/v/parser/parser.v
@@ -1121,15 +1121,20 @@ fn (p &Parser) is_generic_call() bool {
 	} else {
 		false
 	}
+	tok2 := p.peek_token(2)
+	tok3 := p.peek_token(3)
+	tok4 := p.peek_token(4)
+	tok5 := p.peek_token(5)
 	// use heuristics to detect `func<T>()` from `var < expr`
-	return !lit0_is_capital && p.peek_tok.kind == .lt && (match p.peek_token(2).kind {
+	return !lit0_is_capital && p.peek_tok.kind == .lt && (match tok2.kind {
 		.name {
-			// maybe `f<int>`, `f<map[`, f<string,
-			(p.peek_token(2).kind == .name && p.peek_token(3).kind in [.gt, .comma]) || (p.peek_token(2).lit == 'map' && p.peek_token(3).kind == .lsbr)
+			// (`f<int>`, `f<string,`) || (`f<mod.Type>`, `<mod.Type,`) || `f<map[`,
+
+			tok3.kind in [.gt, .comma] || (tok3.kind == .dot && tok4.kind == .name && tok5.kind in [.gt, .comma]) || (tok2.lit == 'map' && tok3.kind == .lsbr)
 		}
 		.lsbr {
 			// maybe `f<[]T>`, assume `var < []` is invalid
-			p.peek_token(3).kind == .rsbr
+			tok3.kind == .rsbr
 		}
 		else {
 			false
diff --git a/vlib/v/tests/generics_test.v b/vlib/v/tests/generics_test.v
index 153e0033b5..21e3d3314d 100644
--- a/vlib/v/tests/generics_test.v
+++ b/vlib/v/tests/generics_test.v
@@ -23,6 +23,8 @@ fn test_identity() {
 
 	assert simple<[]int>([1])[0] == 1
 	assert simple<map[string]string>({'a':'b'})['a'] == 'b'
+
+	assert simple<simplemodule.Data>(simplemodule.Data{value: 0}).value == 0
 }
 
 fn test_plus() {
diff --git a/vlib/v/tests/modules/simplemodule/simplemodule.v b/vlib/v/tests/modules/simplemodule/simplemodule.v
index 6d3b19a5d7..31398309b1 100644
--- a/vlib/v/tests/modules/simplemodule/simplemodule.v
+++ b/vlib/v/tests/modules/simplemodule/simplemodule.v
@@ -10,4 +10,9 @@ pub fn imul(x int, y int) int {
 
 pub struct ThisIsGeneric<T> {
 	msg T
-} 
+}
+
+pub struct Data {
+pub:
+	value int
+}