perf(lang): Gate generic type-use checks
79ddbf6b2f3dc4e12aa79a718e0b3105a4559719bcd8ce6975e9b31e66e21efd
Check for an active generic template before inspecting a resolved type for rigid parameters. Ordinary code does not contribute generic lowering metadata.
1 parent
a45e090d
lib/std/lang/resolver.rad
+1 -1
| 1908 | 1908 | return name; |
|
| 1909 | 1909 | } |
|
| 1910 | 1910 | ||
| 1911 | 1911 | /// Record a symbolic type that lowering will consume from a generic body. |
|
| 1912 | 1912 | fn recordGenericTypeUse(self: *mut Resolver, site: *ast::Node, ty: Type) { |
|
| 1913 | + | let current = self.currentGenericTemplate else return; |
|
| 1913 | 1914 | if not containsGenericParameter(ty) { |
|
| 1914 | 1915 | return; |
|
| 1915 | 1916 | } |
|
| 1916 | - | let current = self.currentGenericTemplate else return; |
|
| 1917 | 1917 | current.typeUses.append( |
|
| 1918 | 1918 | GenericTypeUse { site, ty }, |
|
| 1919 | 1919 | alloc::arenaAllocator(&mut self.arena), |
|
| 1920 | 1920 | ); |
|
| 1921 | 1921 | } |