You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Attempted to use a field selector disabled with NoFieldSelectors
3
+
---
4
+
5
+
## Error Message
6
+
7
+
```
8
+
Example3.hs:14:13: error: [GHC-88464]
9
+
Variable not in scope: fint :: Foo -> Int
10
+
Suggested fix:
11
+
Notice that ‘fint’ is a field selector belonging to the type ‘Foo’
12
+
that has been suppressed by NoFieldSelectors.
13
+
|
14
+
14 | getFooInt = fint
15
+
| ^^^^
16
+
```
17
+
18
+
## Description
19
+
20
+
This example attempts to use the field selector `fint`, despite it being disabled at the definition site (`A.hs`) with `NoFieldSelectors`. This fix is to use pattern matching instead.
21
+
22
+
Notice that record creation and updates still work with `NoFieldSelectors`.
0 commit comments