diff --git a/numba/core/decorators.py b/numba/core/decorators.py
index 5ea8bbbbb..ba0125c16 100644
--- a/numba/core/decorators.py
+++ b/numba/core/decorators.py
@@ -143,6 +143,8 @@ def jit(signature_or_function=None, locals={}, target='cpu', cache=False,
         raise DeprecationError(_msg_deprecated_signature_arg.format('argtypes'))
     if 'restype' in options:
         raise DeprecationError(_msg_deprecated_signature_arg.format('restype'))
+    if options.get('nopython', False) and options.get('forceobj', False):
+        raise ValueError("Only one of 'nopython' or 'forceobj' can be True.")
 
     options['boundscheck'] = boundscheck
 
@@ -232,6 +234,7 @@ def njit(*args, **kws):
         warnings.warn('nopython is set for njit and is ignored', RuntimeWarning)
     if 'forceobj' in kws:
         warnings.warn('forceobj is set for njit and is ignored', RuntimeWarning)
+        del kws['forceobj']
     kws.update({'nopython': True})
     return jit(*args, **kws)
 

No error for jit(nopython=True, forceobj=True)
- [ x] I am using the latest released version of Numba (most recent is visible in
 the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
- [ x] I have included below a minimal working reproducer (if you are unsure how
 to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).

When using the `jit` decorator with both `nopython=True` and `forceobj=True` no error is reported, despite these flags probably being mutually exclusive.
```python
import numba

@numba.jit(nopython=True, forceobj=True)
def f():
    pass

f()
```
The prior example runs without complaints. If the `njit` decorator is used instead, appropriate warnings are thrown.
diff --git a/numba/tests/test_api.py b/numba/tests/test_api.py
index 4e3d67a72..b156ceb6a 100644
--- a/numba/tests/test_api.py
+++ b/numba/tests/test_api.py
@@ -1,4 +1,7 @@
+import warnings
+
 import numba
+from numba import jit, njit
 
 from numba.tests.support import TestCase
 import unittest
@@ -28,5 +31,60 @@ class TestNumbaModule(TestCase):
         numba.__version__  # not in __all__
 
 
+class TestJitDecorator(TestCase):
+    """
+    Test the jit and njit decorators
+    """
+    def test_jit_nopython_forceobj(self):
+        with self.assertRaises(ValueError) as cm:
+            jit(nopython=True, forceobj=True)
+        self.assertIn(
+            "Only one of 'nopython' or 'forceobj' can be True.",
+            str(cm.exception)
+        )
+
+        def py_func(x):
+            return x
+
+        jit_func = jit(nopython=True)(py_func)
+        jit_func(1)
+        # Check length of nopython_signatures to check
+        # which mode the function was compiled in
+        self.assertEqual(len(jit_func.nopython_signatures), 1)
+
+        jit_func = jit(forceobj=True)(py_func)
+        jit_func(1)
+        self.assertEqual(len(jit_func.nopython_signatures), 0)
+
+    def test_njit_nopython_forceobj(self):
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter('always', RuntimeWarning)
+            njit(forceobj=True)
+        self.assertEqual(len(w), 1)
+        self.assertIn(
+            'forceobj is set for njit and is ignored', str(w[0].message)
+        )
+
+        with warnings.catch_warnings(record=True) as w:
+            warnings.simplefilter('always', RuntimeWarning)
+            njit(nopython=True)
+        self.assertEqual(len(w), 1)
+        self.assertIn(
+            'nopython is set for njit and is ignored', str(w[0].message)
+        )
+
+        def py_func(x):
+            return x
+
+        jit_func = njit(nopython=True)(py_func)
+        jit_func(1)
+        self.assertEqual(len(jit_func.nopython_signatures), 1)
+
+        jit_func = njit(forceobj=True)(py_func)
+        jit_func(1)
+        # Since forceobj is ignored this has to compile in nopython mode
+        self.assertEqual(len(jit_func.nopython_signatures), 1)
+
+
 if __name__ == '__main__':
     unittest.main()

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pytest
apt-get update apt-get install -y gcc g++
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
coverage==7.2.7
exceptiongroup==1.2.2
execnet==2.0.2
importlib-metadata==6.7.0
iniconfig==2.0.0
llvmlite==0.33.0
-e git+https://github.com/numba/numba.git@23a5c659e1122c607deb291ff5f7dd796f2a2915#egg=numba
numpy==1.21.6
packaging==24.0
pluggy==1.2.0
pytest==7.4.4
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-xdist==3.5.0
tomli==2.0.1
typing_extensions==4.7.1
zipp==3.15.0

name: numba
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argparse==1.4.0
      - coverage==7.2.7
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - llvmlite==0.33.0
      - numpy==1.21.6
      - packaging==24.0
      - pluggy==1.2.0
      - pytest==7.4.4
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - pytest-xdist==3.5.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/numba

numba/tests/test_api.py::TestJitDecorator::test_jit_nopython_forceobj numba/tests/test_api.py::TestJitDecorator::test_njit_nopython_forceobj
numba/tests/test_api.py::TestNumbaModule::test_numba_module
numba/core/decorators.py
numba/core/decorators.py